Last Used implementiert

This commit is contained in:
2025-09-25 19:52:55 +00:00
parent 0bfb8b2074
commit db431553b9
11 changed files with 270 additions and 7 deletions

View File

@@ -1 +1 @@
{"version":3,"file":"recipes.d.ts","sourceRoot":"","sources":["../../src/routes/recipes.ts"],"names":[],"mappings":"AAIA,QAAA,MAAM,MAAM,4CAAW,CAAC;AAoQxB,eAAe,MAAM,CAAC"}
{"version":3,"file":"recipes.d.ts","sourceRoot":"","sources":["../../src/routes/recipes.ts"],"names":[],"mappings":"AAIA,QAAA,MAAM,MAAM,4CAAW,CAAC;AA6QxB,eAAe,MAAM,CAAC"}

View File

@@ -109,6 +109,13 @@ router.get('/:id', async (req, res, next) => {
console.log(`Could not load separate ingredients for recipe ${recipe.recipeNumber}:`, ingredientError);
}
}
const now = new Date();
prisma.recipe.update({
where: { id: recipeId },
data: { lastUsed: now },
select: { id: true }
}).catch(err => console.warn('lastUsed update failed for recipe', recipeId, err.message));
recipe.lastUsed = now;
return res.json({
success: true,
data: recipe,

File diff suppressed because one or more lines are too long