From e487d6d91eb928dfc6d1e19fb4a7e5c1731e9afe Mon Sep 17 00:00:00 2001 From: Zoe Roux Date: Fri, 12 Jan 2024 18:44:49 +0100 Subject: [PATCH] Fix total score increment --- back/src/auth/auth.controller.ts | 2 +- back/src/users/users.service.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/back/src/auth/auth.controller.ts b/back/src/auth/auth.controller.ts index 9648713..0ed43cf 100644 --- a/back/src/auth/auth.controller.ts +++ b/back/src/auth/auth.controller.ts @@ -317,7 +317,7 @@ export class AuthController { @ApiOkResponse({ description: "Successfully added score" }) @ApiUnauthorizedResponse({ description: "Invalid token" }) @Patch("me/score/:score") - addScore(@Request() req: any, @Param("id") score: number) { + addScore(@Request() req: any, @Param("score") score: number) { return this.usersService.addScore(+req.user.id, score); } } diff --git a/back/src/users/users.service.ts b/back/src/users/users.service.ts index b18b47a..a9ac7be 100644 --- a/back/src/users/users.service.ts +++ b/back/src/users/users.service.ts @@ -122,7 +122,7 @@ export class UsersService { return this.prisma.user.update({ where: { id: where }, data: { - partyPlayed: { + totalScore: { increment: score, }, },