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

@@ -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,