Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API: get all notes of a specific category #510

Closed
tobiasKaminsky opened this issue May 17, 2020 · 7 comments · Fixed by #518
Closed

API: get all notes of a specific category #510

tobiasKaminsky opened this issue May 17, 2020 · 7 comments · Fixed by #518
Labels
feature request Requests for complete new features
Milestone

Comments

@tobiasKaminsky
Copy link
Member

Is your feature request related to a problem? Please describe.
I want to implement woefe/ShoppingList#17
The app shoppingList should store its lists as notes with category "shoppingList".
Therefore it would be great to extend API with
GET /notes/{category}

Describe the solution you'd like
Get all notes from one desired category

Describe alternatives you've considered
Getting all notes and filtering notes

@tobiasKaminsky tobiasKaminsky added the feature request Requests for complete new features label May 17, 2020
@korelstar
Copy link
Member

Sound reasonable. I will extend the API with such a new endpoint. However, GET /notes/{category} is ambiguous, since we already have GET /notes/{id}. Categories named by a number will conflict, then. Therefore, I think I will use GET /notes/by-category/{category}.

@stefan-niedermann
Copy link
Member

or /notes/categories/{category}?

@korelstar
Copy link
Member

Another question is: should the result include notes from the exact category only or also notes from sub-categories?

Example: Note 1 has category recipes and Note 2 has category recipes/cakes.
Should a query for recipes include both notes or only Note 1?

@stefan-niedermann
Copy link
Member

i would expect that all notes from subcategories are included, though i know that the use case of @tobiasKaminsky only needs notes from the main category. Maybe an optional query parameter ?includeSubcategories=true?

@korelstar
Copy link
Member

It looks like the "correct" way for such a filter on the list of notes is to add a query, I.e. GET notes?category=X. So I will use this approach.

Regarding my last question, I think I will only implement the behavior that is needed, for now. So if I understand correctly, this is an exact category match (do not include subcategories). Is this correct, @tobiasKaminsky ?

@korelstar korelstar added this to the 3.4.0 milestone May 19, 2020
@korelstar
Copy link
Member

See #518 for a first implementation. Please check if this is sufficient for you.

@tobiasKaminsky
Copy link
Member Author

Regarding my last question, I think I will only implement the behavior that is needed, for now. So if I understand correctly, this is an exact category match (do not include subcategories). Is this correct, @tobiasKaminsky ?

Yes, for now I do not "need" subcategories.
Thanks for helping out so fast!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Requests for complete new features
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants