diff --git a/src/auth/auth.controller.ts b/src/auth/auth.controller.ts index 6a5f60d..d706461 100644 --- a/src/auth/auth.controller.ts +++ b/src/auth/auth.controller.ts @@ -26,7 +26,6 @@ export class AuthController { return this.authService.signIn(data); } - @UseGuards(AuthGuard) @Post("register") async register(@Body() data: registerDto){ return this.authService.register(data) diff --git a/src/auth/auth.service.ts b/src/auth/auth.service.ts index a147f0e..801ab29 100644 --- a/src/auth/auth.service.ts +++ b/src/auth/auth.service.ts @@ -65,9 +65,13 @@ export class AuthService { return { token: token }; } - async update(id, updateUserDto) {} + async update(userId, updateUserDto) { + return await this.userRepository.update(userId, updateUserDto); + } - async remove(id) {} + async remove(userId: number): Promise { + await this.userRepository.delete(userId); + } //validate tojen of users async validateToken(token: string): Promise { diff --git a/src/auth/dto/registerDto.dto.ts b/src/auth/dto/registerDto.dto.ts index bf922d1..597b033 100644 --- a/src/auth/dto/registerDto.dto.ts +++ b/src/auth/dto/registerDto.dto.ts @@ -1,4 +1,4 @@ -import {IsString, IsNotEmpty,IsNumber,IsEmail } from "class-validator"; +import {IsString, IsNotEmpty,IsNumber } from "class-validator"; export class registerDto{ @@ -14,7 +14,7 @@ export class registerDto{ @IsNotEmpty() id_tipo_usuario:number; - @IsEmail() + @IsString() @IsNotEmpty() correo: string; diff --git a/src/users/dto/userDto.dto.ts b/src/users/dto/userDto.dto.ts index 54d8644..81a5527 100644 --- a/src/users/dto/userDto.dto.ts +++ b/src/users/dto/userDto.dto.ts @@ -13,7 +13,7 @@ export class UserDto{ @IsNotEmpty() id_tipo_usuario:number; - @IsEmail() + @IsString() @IsNotEmpty() correo: string;