Last Used implementiert
This commit is contained in:
7
backend/dist/routes/recipes.js
vendored
7
backend/dist/routes/recipes.js
vendored
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user