se agrego campo correo y nombre a operador
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user