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:
AG
2025-11-24 23:22:09 +02:00
parent cce1e58c7b
commit 72867668d4
7 changed files with 116 additions and 64 deletions

View File

@@ -3,7 +3,13 @@ import { api } from './api';
export const getSessions = async (userId: string): Promise<WorkoutSession[]> => {
try {
return await api.get('/sessions');
const sessions = await api.get('/sessions');
// Convert ISO date strings to timestamps
return sessions.map((session: any) => ({
...session,
startTime: new Date(session.startTime).getTime(),
endTime: session.endTime ? new Date(session.endTime).getTime() : undefined
}));
} catch {
return [];
}