Timer implemented. No working tests.

This commit is contained in:
AG
2025-12-10 23:07:31 +02:00
parent 3df4abba47
commit b86664816d
24 changed files with 806 additions and 116 deletions

View File

@@ -71,9 +71,9 @@ export class AuthController {
const userId = req.user.userId;
await AuthService.updateProfile(userId, req.body);
return sendSuccess(res, null);
} catch (error) {
} catch (error: any) {
logger.error('Error in updateProfile', { error });
return sendError(res, 'Server error', 500);
return sendError(res, error.message || 'Server error', 500);
}
}

View File

@@ -20,9 +20,9 @@ export class PlanController {
const userId = req.user.userId;
const plan = await PlanService.savePlan(userId, req.body);
return sendSuccess(res, plan);
} catch (error) {
} catch (error: any) {
logger.error('Error in savePlan', { error });
return sendError(res, 'Server error', 500);
return sendError(res, error.message || 'Server error', 500);
}
}

View File

@@ -27,6 +27,7 @@ export const updateProfileSchema = z.object({
height: z.number().optional(),
gender: z.string().optional(),
birthDate: z.string().optional(),
language: z.string().optional()
language: z.string().optional(),
restTimerDefault: z.number().optional()
})
})

View File

@@ -1,3 +1,4 @@
// forcing reload
import prisma from '../lib/prisma';
export class PlanService {
@@ -21,6 +22,7 @@ export class PlanService {
exerciseName: pe.exercise.name,
exerciseType: pe.exercise.type,
isWeighted: pe.isWeighted,
restTimeSeconds: pe.restTime
}))
}));
}
@@ -54,7 +56,8 @@ export class PlanService {
planId: id,
exerciseId: step.exerciseId,
order: index,
isWeighted: step.isWeighted || false
isWeighted: step.isWeighted || false,
restTime: step.restTimeSeconds
}))
});
}
@@ -79,7 +82,8 @@ export class PlanService {
exerciseId: pe.exerciseId,
exerciseName: pe.exercise.name,
exerciseType: pe.exercise.type,
isWeighted: pe.isWeighted
isWeighted: pe.isWeighted,
restTimeSeconds: pe.restTime
}))
};
}