diff --git a/frontend/components/Domain/Recipe/RecipeCardSection.vue b/frontend/components/Domain/Recipe/RecipeCardSection.vue index c93654662d75..80ce0a8b893f 100644 --- a/frontend/components/Domain/Recipe/RecipeCardSection.vue +++ b/frontend/components/Domain/Recipe/RecipeCardSection.vue @@ -161,6 +161,10 @@ export default defineComponent({ type: Array as () => Recipe[], default: () => [], }, + cookbookSlug: { + type: String, + default: null, + }, categorySlug: { type: String, default: null, @@ -213,6 +217,8 @@ export default defineComponent({ const hasMore = ref(true); const ready = ref(false); const loading = ref(false); + + const cookbook = ref(props.cookbookSlug); const category = ref(props.categorySlug); const tag = ref(props.tagSlug); const tool = ref(props.toolSlug); @@ -227,6 +233,7 @@ export default defineComponent({ perPage.value*2, preferences.value.orderBy, preferences.value.orderDirection, + cookbook.value, category.value, tag.value, tool.value, @@ -253,6 +260,7 @@ export default defineComponent({ perPage.value, preferences.value.orderBy, preferences.value.orderDirection, + cookbook.value, category.value, tag.value, tool.value, @@ -314,6 +322,7 @@ export default defineComponent({ perPage.value, preferences.value.orderBy, preferences.value.orderDirection, + cookbook.value, category.value, tag.value, tool.value, diff --git a/frontend/composables/recipes/use-recipes.ts b/frontend/composables/recipes/use-recipes.ts index 176507ea609d..723e8ff1a8bf 100644 --- a/frontend/composables/recipes/use-recipes.ts +++ b/frontend/composables/recipes/use-recipes.ts @@ -11,8 +11,17 @@ export const useLazyRecipes = function () { const recipes = ref([]); - 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 : []; } diff --git a/frontend/pages/cookbooks/_slug.vue b/frontend/pages/cookbooks/_slug.vue index 853ea8152233..2418dc4e1182 100644 --- a/frontend/pages/cookbooks/_slug.vue +++ b/frontend/pages/cookbooks/_slug.vue @@ -11,25 +11,35 @@ - +