-
-
Notifications
You must be signed in to change notification settings - Fork 854
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
fix: Fixed LastMade recipes sorting order #4980
fix: Fixed LastMade recipes sorting order #4980
Conversation
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.
I don't think we want to bake this into the repository on the backend. The backend already supports specifying null ordering. Can we make this change to the frontend query instead?
With my limited knowledge I couldnt find a way to make it work on the front end, but I will experiment with what you showed in the screenshot.
…On Wed, 29 Jan 2025, 17:46 Michael Genson, ***@***.***> wrote:
***@***.**** requested changes on this pull request.
I don't think we want to bake this into the repository on the backend. The
backend already supports specifying null ordering
<https://docs.mealie.io/documentation/getting-started/api-usage/#order-by>.
Can we make this change to the frontend query instead?
From the API docs:
image.png (view on web)
<https://github.com/user-attachments/assets/df37bf49-c666-4880-a2a7-a94e32a34316>
—
Reply to this email directly, view it on GitHub
<#4980 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AE4662Q2KBXZK5CHQSG5DED2NEHYFAVCNFSM6AAAAABWDARUAWVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDKOBRG44TGMZWHA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
You can probably add some logic here that handles null sorting: mealie/frontend/components/Domain/Recipe/RecipeCardSection.vue Lines 238 to 248 in 4229061
You can calculate the order by null, something like: const orderDir = props.query?.orderDirection || preferences.value.orderDirection;
const orderByNull = orderDir === "asc" ? "first" : "last" Then pass |
See what you think now? |
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.
Looks good! Just a couple small code cleanliness things
Co-authored-by: Michael Genson <71845777+michael-genson@users.noreply.github.com>
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.
Looks great now, thanks for this! I think since I pushed the last bit someone else will have to approve it, but putting my approval here anyway for visibility
What this PR does / why we need it:
Fixes postgres incorrectly sorting null as the most recent.
-->
Which issue(s) this PR fixes:
Fixes #4937
Special notes for your reviewer:
The original problem was only reproduced in postgres - in sqlite it was fine.
Testing
Ran checks