Timer implemented. No working tests.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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()
|
||||
})
|
||||
})
|
||||
|
||||
@@ -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
|
||||
}))
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user