also search through season, exclude "🍽️"recipes from being in season
This commit is contained in:
parent
09b5e99867
commit
e2a7de3e90
@ -27,14 +27,14 @@ h1{
|
|||||||
</svelte:head>
|
</svelte:head>
|
||||||
|
|
||||||
<h1>Rezepte</h1>
|
<h1>Rezepte</h1>
|
||||||
<section>
|
|
||||||
|
<Search></Search>
|
||||||
|
|
||||||
<MediaScroller title="In Saison">
|
<MediaScroller title="In Saison">
|
||||||
{#each data.season as recipe}
|
{#each data.season as recipe}
|
||||||
<Card {recipe} {current_month} search=""></Card>
|
<Card {recipe} {current_month}></Card>
|
||||||
{/each}
|
{/each}
|
||||||
</MediaScroller>
|
</MediaScroller>
|
||||||
</section>
|
|
||||||
<Search></Search>
|
|
||||||
|
|
||||||
{#each categories as category}
|
{#each categories as category}
|
||||||
<MediaScroller title={category}>
|
<MediaScroller title={category}>
|
||||||
|
@ -6,7 +6,7 @@ import { rand_array } from '$lib/js/randomize';
|
|||||||
|
|
||||||
export const GET: RequestHandler = async ({params}) => {
|
export const GET: RequestHandler = async ({params}) => {
|
||||||
await dbConnect();
|
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();
|
await dbDisconnect();
|
||||||
found_in_season = JSON.parse(JSON.stringify(found_in_season));
|
found_in_season = JSON.parse(JSON.stringify(found_in_season));
|
||||||
return json(found_in_season);
|
return json(found_in_season);
|
||||||
|
Loading…
Reference in New Issue
Block a user