From e2a7de3e90801276c2a6e70262050bb672a012f0 Mon Sep 17 00:00:00 2001 From: Alexander Bocken Date: Fri, 19 Jan 2024 20:12:09 +0100 Subject: [PATCH] =?UTF-8?q?also=20search=20through=20season,=20exclude=20"?= =?UTF-8?q?=F0=9F=8D=BD=EF=B8=8F"recipes=20from=20being=20in=20season?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/routes/(rezepte)/rezepte/+page.svelte | 8 ++++---- src/routes/api/rezepte/items/in_season/[month]/+server.ts | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/routes/(rezepte)/rezepte/+page.svelte b/src/routes/(rezepte)/rezepte/+page.svelte index 5258eed..6d15dd0 100644 --- a/src/routes/(rezepte)/rezepte/+page.svelte +++ b/src/routes/(rezepte)/rezepte/+page.svelte @@ -27,14 +27,14 @@ h1{

Rezepte

-
+ + + {#each data.season as recipe} - + {/each} -
- {#each categories as category} diff --git a/src/routes/api/rezepte/items/in_season/[month]/+server.ts b/src/routes/api/rezepte/items/in_season/[month]/+server.ts index 8660f4b..e44666a 100644 --- a/src/routes/api/rezepte/items/in_season/[month]/+server.ts +++ b/src/routes/api/rezepte/items/in_season/[month]/+server.ts @@ -6,7 +6,7 @@ import { rand_array } from '$lib/js/randomize'; export const GET: RequestHandler = async ({params}) => { await dbConnect(); - let found_in_season = rand_array(await Recipe.find({season: params.month}, 'name short_name images tags category icon description season').lean()); + let found_in_season = rand_array(await Recipe.find({season: params.month, icon: {$ne: "🍽️"}}, 'name short_name images tags category icon description season').lean()); await dbDisconnect(); found_in_season = JSON.parse(JSON.stringify(found_in_season)); return json(found_in_season);