se agrego campo correo y nombre a operador

This commit is contained in:
xXpuma99Xx
2022-07-12 18:21:42 -05:00
parent 64b6258506
commit 1cf244980d
2 changed files with 4 additions and 3 deletions
+3 -2
View File
@@ -1,4 +1,4 @@
import { IsEmail, IsInt, IsString } from 'class-validator';
import { IsEmail, IsInt, IsOptional, IsString } from 'class-validator';
export class CreateOperadorDto {
@IsEmail()
@@ -17,5 +17,6 @@ export class CreateOperadorDto {
operador: string;
@IsString()
password: string;
@IsOptional()
password?: string;
}
+1 -1
View File
@@ -72,7 +72,7 @@ export class OperadorService {
throw new ConflictException(
'Ya existe un operador en esta institución con ese nombre, intenta de nuevo con otro.',
);
if (password!) password = this.bcryptService.generarPassword();
if (!password) password = this.bcryptService.generarPassword();
return this.repository.save(
this.repository.create({
correo,