mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-14 23:41:08 +02:00
fix(manadeck): align study session with schema
- Rename endedAt to completedAt to match database schema - Add mode field for study session 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
48df2b88bb
commit
3339aa2892
1 changed files with 3 additions and 2 deletions
|
|
@ -708,8 +708,9 @@ export class ApiController {
|
|||
const session = await this.studySessionRepository.create({
|
||||
userId: user.sub,
|
||||
deckId: sessionData.deckId,
|
||||
mode: sessionData.mode || 'all',
|
||||
startedAt: sessionData.startedAt || new Date(),
|
||||
endedAt: sessionData.endedAt,
|
||||
completedAt: sessionData.endedAt,
|
||||
totalCards: sessionData.totalCards || 0,
|
||||
completedCards: sessionData.completedCards || 0,
|
||||
correctCards: sessionData.correctCards || 0,
|
||||
|
|
@ -732,7 +733,7 @@ export class ApiController {
|
|||
this.logger.log(`Updating study session ${sessionId} for user: ${user.sub}`);
|
||||
|
||||
const session = await this.studySessionRepository.update(sessionId, user.sub, {
|
||||
endedAt: sessionData.endedAt,
|
||||
completedAt: sessionData.endedAt,
|
||||
totalCards: sessionData.totalCards,
|
||||
completedCards: sessionData.completedCards,
|
||||
correctCards: sessionData.correctCards,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue