also search through season, exclude "🍽️"recipes from being in season

This commit is contained in:
Alexander Bocken 2024-01-19 20:12:09 +01:00
parent 09b5e99867
commit e2a7de3e90
Signed by: Alexander
GPG Key ID: 1D237BE83F9B05E8
2 changed files with 5 additions and 5 deletions

View File

@ -27,14 +27,14 @@ h1{
</svelte:head>
<h1>Rezepte</h1>
<section>
<Search></Search>
<MediaScroller title="In Saison">
{#each data.season as recipe}
<Card {recipe} {current_month} search=""></Card>
<Card {recipe} {current_month}></Card>
{/each}
</MediaScroller>
</section>
<Search></Search>
{#each categories as category}
<MediaScroller title={category}>

View File

@ -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);