Skip to content

Commit

Permalink
add time save
Browse files Browse the repository at this point in the history
  • Loading branch information
Szotkowski committed Sep 20, 2023
1 parent 5b7bd96 commit 64a48c5
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/controllers/user-progress.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export class UserProgressController {
@repository(UserRepository) protected userRepository: UserRepository,
@repository(UserRepository)
protected progressRepository: ProgressRepository,
) {}
) { }

@authenticate('jwt')
@post('/users/{id}/progresses/{progressId}', {
Expand All @@ -57,8 +57,9 @@ export class UserProgressController {
instructionId: {type: 'number'},
stepId: {type: 'number'},
descriptionId: {type: 'number'},
time: {type: 'number'},
},
required: ['instructionId', 'stepId', 'descriptionId'],
required: ['instructionId', 'stepId', 'descriptionId', 'time'],
},
},
},
Expand Down Expand Up @@ -112,6 +113,7 @@ export class UserProgressController {
properties: {
stepId: {type: 'number'},
descriptionId: {type: 'number'},
time: {type: 'number'},
},
},
},
Expand Down
14 changes: 14 additions & 0 deletions src/models/progress.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,20 @@ export class Progress extends Entity {
})
descriptionId: number;

@property({
type: 'number',
required: true,
postgresql: {
columnName: 'time',
dataType: 'integer',
dataLength: null,
dataPrecision: null,
dataScale: null,
nullable: 'NO',
},
})
time: number;

@property({
type: 'number',
})
Expand Down

0 comments on commit 64a48c5

Please sign in to comment.