Excessive logging deprecated
This commit is contained in:
@@ -35,7 +35,7 @@ router.get('/', async (req: any, res) => {
|
||||
]
|
||||
}
|
||||
});
|
||||
console.log('GET /exercises - Returning:', exercises.map(e => ({ id: e.id, name: e.name, isArchived: e.isArchived })));
|
||||
|
||||
res.json(exercises);
|
||||
} catch (error) {
|
||||
res.status(500).json({ error: 'Server error' });
|
||||
@@ -48,7 +48,7 @@ router.post('/', async (req: any, res) => {
|
||||
const userId = req.user.userId;
|
||||
const { id, name, type, bodyWeightPercentage, isArchived } = req.body;
|
||||
|
||||
console.log('POST /exercises - Received:', { id, name, type, bodyWeightPercentage, isArchived });
|
||||
|
||||
|
||||
// If id exists and belongs to user, update. Else create.
|
||||
// Note: We can't update system exercises directly. If user edits a system exercise,
|
||||
@@ -59,12 +59,12 @@ router.post('/', async (req: any, res) => {
|
||||
// Check if it exists and belongs to user
|
||||
const existing = await prisma.exercise.findUnique({ where: { id } });
|
||||
if (existing && existing.userId === userId) {
|
||||
console.log('Updating existing exercise with:', { name, type, bodyWeightPercentage, isArchived });
|
||||
|
||||
const updated = await prisma.exercise.update({
|
||||
where: { id },
|
||||
data: { name, type, bodyWeightPercentage, isArchived }
|
||||
});
|
||||
console.log('Updated exercise:', updated);
|
||||
|
||||
return res.json(updated);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user