intentando resolver
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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<void> {
|
||||
await this.userRepository.delete(userId);
|
||||
}
|
||||
|
||||
//validate tojen of users
|
||||
async validateToken(token: string): Promise<User> {
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ export class UserDto{
|
||||
@IsNotEmpty()
|
||||
id_tipo_usuario:number;
|
||||
|
||||
@IsEmail()
|
||||
@IsString()
|
||||
@IsNotEmpty()
|
||||
correo: string;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user