fixed bug

This commit is contained in:
2024-06-18 16:38:34 -06:00
parent 6945846ef5
commit 30048aa544
6 changed files with 16 additions and 16 deletions
-1
View File
@@ -1,7 +1,6 @@
import { Body, Controller, Delete, Get, Param, ParseIntPipe, Post, Put } from '@nestjs/common';
import { ProfesorService } from './profesor.service';
import { profesorDto } from './dto/profesorDto.dto';
import { ProfesorFilterDto } from './dto/profesorFilterDto.dto';
@Controller('profesor')
export class ProfesorController {
+1 -6
View File
@@ -26,6 +26,7 @@ export class AuthController {
return this.authService.signIn(data);
}
@UseGuards(AuthGuard)
@Post("register")
async register(@Body() data: registerDto){
return this.authService.register(data)
@@ -37,12 +38,6 @@ export class AuthController {
return req.user;
}
@UseGuards(AuthGuard)
@Post('Alta')
async create(@Body() data: UserDto) {
return this.authService.create(data);
}
@UseGuards(AuthGuard)
@Put('Modificacion/:id')
async update(@Param('id') id: number, @Body() updateUserDto: Record<string, any>) {
-2
View File
@@ -65,8 +65,6 @@ export class AuthService {
return { token: token };
}
async create(data) {}
async update(id, updateUserDto) {}
async remove(id) {}
+2 -2
View File
@@ -1,4 +1,4 @@
import {IsString, IsNotEmpty,IsNumber } from "class-validator";
import {IsString, IsNotEmpty,IsNumber,IsEmail } from "class-validator";
export class registerDto{
@@ -14,7 +14,7 @@ export class registerDto{
@IsNotEmpty()
id_tipo_usuario:number;
@IsString()
@IsEmail()
@IsNotEmpty()
correo: string;
+9 -1
View File
@@ -1,4 +1,4 @@
import { IsEmail, IsNotEmpty, IsString} from "class-validator";
import { IsEmail, IsNotEmpty, IsString,IsNumber} from "class-validator";
export class UserDto{
@IsString()
@@ -9,4 +9,12 @@ export class UserDto{
@IsNotEmpty()
contraseña: string;
@IsNumber()
@IsNotEmpty()
id_tipo_usuario:number;
@IsEmail()
@IsNotEmpty()
correo: string;
}
+4 -4
View File
@@ -19,10 +19,10 @@ export class UsersService {
const newUser = this.users.create(user);
return this.users.save(newUser);
}
//TODO Validar Esta funcion
// async update(userId: number, updateUserDto: UserDto): Promise<User> {
// return await this.users.update(userId, updateUserDto);
// }
//async update(userId: number, updateUserDto: UserDto): Promise<User> {
//return await this.users.update(userId, updateUserDto);
//}
async remove(userId: number): Promise<void> {
await this.users.delete(userId);