From 4b213647359284d4b2424e5b29f6a00c3ac93ac8 Mon Sep 17 00:00:00 2001 From: Felipe Rodrigues de Santana Freitag Date: Sun, 3 Dec 2023 19:31:38 -0300 Subject: [PATCH] feat: add the possibility to update the user badge --- src/user/dto/update-user.dto.ts | 4 ++++ src/user/user.service.ts | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/user/dto/update-user.dto.ts b/src/user/dto/update-user.dto.ts index 6e58565..0ed8a44 100644 --- a/src/user/dto/update-user.dto.ts +++ b/src/user/dto/update-user.dto.ts @@ -1,4 +1,5 @@ import { ApiProperty } from "@nestjs/swagger"; +import { Badge } from "src/badge/entities/badge.entity"; import { Expertise } from "src/expertise/entities/expertise.entity"; export class UpdateUserDto { @@ -15,4 +16,7 @@ export class UpdateUserDto { type: [String], }) expertises: Expertise[]; + + @ApiProperty() + badge: Badge; } \ No newline at end of file diff --git a/src/user/user.service.ts b/src/user/user.service.ts index b594c93..a6d84c3 100644 --- a/src/user/user.service.ts +++ b/src/user/user.service.ts @@ -118,7 +118,7 @@ export class UserService { email: updateUserDto.email, hashPassword: user.hashPassword, xp: user.xp, - currentBadge: user.currentBadge, + currentBadge: updateUserDto.badge, expertises: updateUserDto.expertises };