mirror of
https://github.com/hay-kot/mealie.git
synced 2025-08-22 14:33:33 -07:00
Merge branch 'mealie-next' into fix/not-found-when-recipe-image-is-changed
This commit is contained in:
commit
71c6d49127
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