1
0
Fork 0
mirror of https://github.com/mealie-recipes/mealie.git synced 2025-08-02 20:15:24 +02:00

fix: cookbook random recipe selector (#5768)

This commit is contained in:
Mario Džoić 2025-07-21 17:02:36 +02:00 committed by GitHub
parent 6d1e39f871
commit c1e5937ff3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -90,6 +90,8 @@ export const useLazyRecipes = function (publicGroupSlug: string | null = null) {
}
async function getRandom(query: RecipeSearchQuery | null = null, queryFilter: string | null = null) {
query = query || {};
query._searchSeed = query._searchSeed || Date.now().toString();
const { data } = await api.recipes.getAll(1, 1, getParams("random", "desc", null, query, queryFilter));
if (data?.items.length) {
return data.items[0];