mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-08-05 05:25:26 +02:00
feat: added "cookbook" filter to recipe pagination to serve frontend (#1609)
* added cookbook filter to recipe pagination * fixed wrong filter var * restored cookbook sorting * reverted unnecessary var change
This commit is contained in:
parent
d26cb570ba
commit
2007bcfe28
5 changed files with 80 additions and 9 deletions
|
@ -11,8 +11,17 @@ export const useLazyRecipes = function () {
|
|||
|
||||
const recipes = ref<Recipe[]>([]);
|
||||
|
||||
async function fetchMore(page: number, perPage: number, orderBy: string | null = null, orderDirection = "desc", category: string | null = null, tag: string | null = null, tool: string | null = null) {
|
||||
const { data } = await api.recipes.getAll(page, perPage, { orderBy, orderDirection, "categories": category, "tags": tag, "tools": tool });
|
||||
async function fetchMore(
|
||||
page: number,
|
||||
perPage: number,
|
||||
orderBy: string | null = null,
|
||||
orderDirection = "desc",
|
||||
cookbook: string | null = null,
|
||||
category: string | null = null,
|
||||
tag: string | null = null,
|
||||
tool: string | null = null
|
||||
) {
|
||||
const { data } = await api.recipes.getAll(page, perPage, { orderBy, orderDirection, cookbook, "categories": category, "tags": tag, "tools": tool });
|
||||
return data ? data.items : [];
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue