log page views
This commit is contained in:
parent
db8b20ee71
commit
2e7d9e6ba6
1 changed files with 2 additions and 0 deletions
|
@ -12,6 +12,7 @@ class RecipeModel {
|
||||||
|
|
||||||
async getAllRecipes(): Promise<any[]> {
|
async getAllRecipes(): Promise<any[]> {
|
||||||
try {
|
try {
|
||||||
|
logger.info("index page view")
|
||||||
return await this.prisma.recipes.findMany();
|
return await this.prisma.recipes.findMany();
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error("Error fetching all recipes:", err);
|
console.error("Error fetching all recipes:", err);
|
||||||
|
@ -45,6 +46,7 @@ class RecipeModel {
|
||||||
instruction: step.instruction,
|
instruction: step.instruction,
|
||||||
})),
|
})),
|
||||||
};
|
};
|
||||||
|
logger.info("recipe page view", { recipe_id: data.details.id, recipe_name: data.details.name })
|
||||||
return data;
|
return data;
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.log("Error finding recipe:", err);
|
console.log("Error finding recipe:", err);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue