Icon route added

This commit is contained in:
2023-07-03 12:39:34 +02:00
parent c7b257180f
commit e4e153fe1b
12 changed files with 205 additions and 27 deletions

View File

@ -5,7 +5,7 @@ import type {BriefRecipeType} from '../../../../../types/types';
export const GET: RequestHandler = async ({params}) => {
await dbConnect();
let recipes = (await Recipe.find({tags: params.icon}, 'name short_name images tags category icon description season').lean()) as BriefRecipeType[];
let recipes = (await Recipe.find({icon: params.icon}, 'name short_name images tags category icon description season').lean()) as BriefRecipeType[];
await dbDisconnect();
recipes = JSON.parse(JSON.stringify(recipes));