add forgotten updated api routes
This commit is contained in:
		@@ -6,7 +6,7 @@ import { rand_array } from '$lib/js/randomize';
 | 
			
		||||
 | 
			
		||||
export const GET: RequestHandler = async ({params}) => {
 | 
			
		||||
  await dbConnect();
 | 
			
		||||
  let found_brief = rand_array(await Recipe.find({}, 'name short_name tags category icon description season').lean()) as BriefRecipeType[];
 | 
			
		||||
  let found_brief = rand_array(await Recipe.find({}, 'name short_name tags category icon description season dateModified').lean()) as BriefRecipeType[];
 | 
			
		||||
  await dbDisconnect();
 | 
			
		||||
  return json(JSON.parse(JSON.stringify(found_brief)));
 | 
			
		||||
};
 | 
			
		||||
 
 | 
			
		||||
@@ -6,7 +6,7 @@ import { rand_array } from '$lib/js/randomize';
 | 
			
		||||
 | 
			
		||||
export const GET: RequestHandler = async ({params}) => {
 | 
			
		||||
  await dbConnect();
 | 
			
		||||
  let recipes = rand_array(await Recipe.find({category: params.category}, 'name short_name images tags category icon description season').lean()) as BriefRecipeType[];
 | 
			
		||||
  let recipes = rand_array(await Recipe.find({category: params.category}, 'name short_name images tags category icon description season dateModified').lean()) as BriefRecipeType[];
 | 
			
		||||
  await dbDisconnect();
 | 
			
		||||
 | 
			
		||||
  recipes = JSON.parse(JSON.stringify(recipes));
 | 
			
		||||
 
 | 
			
		||||
@@ -6,7 +6,7 @@ import { rand_array } from '$lib/js/randomize';
 | 
			
		||||
 | 
			
		||||
export const GET: RequestHandler = async ({params}) => {
 | 
			
		||||
  await dbConnect();
 | 
			
		||||
  let recipes = rand_array(await Recipe.find({icon: params.icon}, 'name short_name images tags category icon description season').lean()) as BriefRecipeType[];
 | 
			
		||||
  let recipes = rand_array(await Recipe.find({icon: params.icon}, 'name short_name images tags category icon description season dateModified').lean()) as BriefRecipeType[];
 | 
			
		||||
  await dbDisconnect();
 | 
			
		||||
 | 
			
		||||
  recipes = JSON.parse(JSON.stringify(recipes));
 | 
			
		||||
 
 | 
			
		||||
@@ -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, icon: {$ne: "🍽️"}}, '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 dateModified').lean());
 | 
			
		||||
  await dbDisconnect();
 | 
			
		||||
  found_in_season = JSON.parse(JSON.stringify(found_in_season));
 | 
			
		||||
  return json(found_in_season);
 | 
			
		||||
 
 | 
			
		||||
@@ -6,7 +6,7 @@ import { rand_array } from '$lib/js/randomize';
 | 
			
		||||
 | 
			
		||||
export const GET: RequestHandler = async ({params}) => {
 | 
			
		||||
  await dbConnect();
 | 
			
		||||
  let recipes = rand_array(await Recipe.find({tags: params.tag}, 'name short_name images tags category icon description season').lean()) as BriefRecipeType[];
 | 
			
		||||
  let recipes = rand_array(await Recipe.find({tags: params.tag}, 'name short_name images tags category icon description season dateModified').lean()) as BriefRecipeType[];
 | 
			
		||||
  await dbDisconnect();
 | 
			
		||||
 | 
			
		||||
  recipes = JSON.parse(JSON.stringify(recipes));
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user