1. Session end time saving. 2. Plan Id to the saved session. 3. History page redesigned (attributes moved, sets list hidden. 4. Session duration added. 5. Session start and end time logging fixed.
This commit is contained in:
@@ -40,7 +40,7 @@ router.get('/', async (req: any, res) => {
|
||||
router.post('/', async (req: any, res) => {
|
||||
try {
|
||||
const userId = req.user.userId;
|
||||
const { id, startTime, endTime, userBodyWeight, note, sets } = req.body;
|
||||
const { id, startTime, endTime, userBodyWeight, note, planId, planName, sets } = req.body;
|
||||
|
||||
// Convert timestamps to Date objects if they are numbers
|
||||
const start = new Date(startTime);
|
||||
@@ -62,6 +62,8 @@ router.post('/', async (req: any, res) => {
|
||||
endTime: end,
|
||||
userBodyWeight: weight,
|
||||
note,
|
||||
planId,
|
||||
planName,
|
||||
sets: {
|
||||
create: sets.map((s: any, idx: number) => ({
|
||||
exerciseId: s.exerciseId,
|
||||
@@ -87,6 +89,8 @@ router.post('/', async (req: any, res) => {
|
||||
endTime: end,
|
||||
userBodyWeight: weight,
|
||||
note,
|
||||
planId,
|
||||
planName,
|
||||
sets: {
|
||||
create: sets.map((s: any, idx: number) => ({
|
||||
exerciseId: s.exerciseId,
|
||||
|
||||
Reference in New Issue
Block a user