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:
parent
6d1e39f871
commit
c1e5937ff3
1 changed files with 2 additions and 0 deletions
|
@ -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];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue