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

fix: Random Recipes not choosing from all recipes #4435

Open
wants to merge 2 commits into
base: mealie-next
Choose a base branch
from

Conversation

michael-genson
Copy link
Collaborator

What type of PR is this?

(REQUIRED)

  • bug

What this PR does / why we need it:

(REQUIRED)

Our way of choosing a random recipe in the frontend assumes all recipes are loaded, but since we're paginating they're not.
This PR makes an extra API call to choose a random recipe using the backend, consequently choosing a recipe from the entire db (rather than one or two pages).

Which issue(s) this PR fixes:

(REQUIRED)

Fixes #4250

Testing

(fill-in or delete this section)

Manually hit random a few times and confirmed I'm seeing more than just the first two pages of recipes. I can also see the API call. I also tested to make sure other filters are preserved (e.g. if you have a category filter, then clicking random preserves the filter in its recipe pool).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] - Random button on homepage only picks from newer recipes
1 participant