mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-08-04 04:55:21 +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) {
|
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));
|
const { data } = await api.recipes.getAll(1, 1, getParams("random", "desc", null, query, queryFilter));
|
||||||
if (data?.items.length) {
|
if (data?.items.length) {
|
||||||
return data.items[0];
|
return data.items[0];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue