-
-
Notifications
You must be signed in to change notification settings - Fork 791
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
feat: sort labels by name,asc in shopping lists #4253
feat: sort labels by name,asc in shopping lists #4253
Conversation
I don't think this is something we want to do on the backend; is there somewhere in particular on the frontend you labels aren't sorted alphabetically? If so, we should address it there |
Ah okay, that makes sense. Is it possible to use the label store here instead of using const { store: allLabels, actions: labelActions } = useLabelStore(); // this already partially exists on line 605 And then we can just call |
Updated. But I used The |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for keeping with this one!
What type of PR is this?
What this PR does / why we need it:
This is an initial (partial) implementation of the request in this discussion: #3297.
Incontroller_labels.py
it extends thePaginationQuery
class to override the default values fororder_by
andorder_direction
so that call to this endpoint will use those as the default, rather than using nothing.Update
frontend/pages/shopping-lists/_id.vue
to passorderBy: "name"
andorderDirection: "asc"
on label refreshesWhich issue(s) this PR fixes:
No issues reference this specifically. This is intended as an initial step towards the feature requested in This is an initial implementation of the request in this discussion: #3297.
Special notes for your reviewer:
I am not experienced with FastAPI or Mealie conventions. I am happy to apply the same pattern to the paginated GET requests of the other listed models, but I wanted to get some input on the pattern and implementation before copying the pattern around.Testing
in Swagger UI, I tested passing other values fororder_by
andorder_direction
to verify they were used over the new defaults. Similarly, tested with other pre-existing values likeper_page
to ensure they were still respected.order_by
andorder_direction
is now specifyingname
andasc