usuario aun funcional
This commit is contained in:
@@ -337,14 +337,10 @@ export class UploadFileService {
|
||||
`${usuarios[i].apellido_p.trim()} ${usuarios[
|
||||
i
|
||||
].apellido_m.trim()} ${usuarios[i].nombres.trim()}`,
|
||||
institucion,
|
||||
tipoUsuario,
|
||||
institucionCarrera,
|
||||
)
|
||||
.then((res) => {
|
||||
usuariosNuevos.push(res.usuario);
|
||||
mensajes.push(res.message);
|
||||
});
|
||||
.then((usuarioNuevo) => usuariosNuevos.push(usuarioNuevo));
|
||||
}
|
||||
return {
|
||||
message: 'Se subió y cargó correctamente tu archivo csv.',
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { IsNumberString } from 'class-validator';
|
||||
import { IsNumberString, IsString } from 'class-validator';
|
||||
|
||||
export class UsuarioDgaeDto {
|
||||
@IsNumberString()
|
||||
usuario: string;
|
||||
|
||||
@IsNumberString()
|
||||
id_institucion_carrera: string;
|
||||
|
||||
@IsString()
|
||||
usuario: string;
|
||||
}
|
||||
|
||||
@@ -4,6 +4,6 @@ export class UsuarioDgpDto {
|
||||
@IsString()
|
||||
rfc: string;
|
||||
|
||||
@IsNumberString()
|
||||
@IsString()
|
||||
usuario: string;
|
||||
}
|
||||
|
||||
@@ -14,6 +14,10 @@ export class UsuarioUpdateDto {
|
||||
@IsOptional()
|
||||
activo?: boolean;
|
||||
|
||||
@IsEmail()
|
||||
@IsOptional()
|
||||
correo?: string;
|
||||
|
||||
@IsBoolean()
|
||||
@IsOptional()
|
||||
multa?: boolean;
|
||||
@@ -21,8 +25,4 @@ export class UsuarioUpdateDto {
|
||||
@IsPhoneNumber('MX')
|
||||
@IsOptional()
|
||||
telefono?: string;
|
||||
|
||||
@IsEmail()
|
||||
@IsOptional()
|
||||
correo?: string;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { IsNumberString } from 'class-validator';
|
||||
import { IsString } from 'class-validator';
|
||||
|
||||
export class UsuarioDto {
|
||||
@IsNumberString()
|
||||
@IsString()
|
||||
usuario: string;
|
||||
}
|
||||
|
||||
@@ -6,11 +6,11 @@ export class UsuarioUsuariosDto {
|
||||
|
||||
@IsNumberString()
|
||||
@IsOptional()
|
||||
id_institucion?: string;
|
||||
id_carrera?: string;
|
||||
|
||||
@IsNumberString()
|
||||
@IsOptional()
|
||||
id_carrera?: string;
|
||||
id_institucion?: string;
|
||||
|
||||
@IsNumberString()
|
||||
@IsOptional()
|
||||
@@ -20,7 +20,7 @@ export class UsuarioUsuariosDto {
|
||||
@IsOptional()
|
||||
nombre?: string;
|
||||
|
||||
@IsNumberString()
|
||||
@IsString()
|
||||
@IsOptional()
|
||||
usuario?: string;
|
||||
}
|
||||
|
||||
@@ -32,24 +32,17 @@ export class UsuarioService {
|
||||
async create(
|
||||
usuario: string,
|
||||
nombre: string,
|
||||
institucion: Institucion,
|
||||
tipoUsuario: TipoUsuario,
|
||||
institucionCarrera: InstitucionCarrera,
|
||||
) {
|
||||
const data: {
|
||||
institucionCarrera: InstitucionCarrera;
|
||||
institucion: Institucion;
|
||||
nombre: string;
|
||||
tipoUsuario: TipoUsuario;
|
||||
usuario: string;
|
||||
} = { institucion, nombre, tipoUsuario, usuario, institucionCarrera };
|
||||
|
||||
return this.repository
|
||||
.save(this.repository.create(data))
|
||||
.then((usuario) => ({
|
||||
message: `Se creó correctamente un usuario.`,
|
||||
return this.repository.save(
|
||||
this.repository.create({
|
||||
nombre,
|
||||
tipoUsuario,
|
||||
usuario,
|
||||
}));
|
||||
institucionCarrera,
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
correoPassword(password: string) {
|
||||
@@ -223,7 +216,10 @@ export class UsuarioService {
|
||||
html: this.correoPassword(password),
|
||||
}),
|
||||
)
|
||||
.then((_) => ({ message: 'Se registró correctamente un usuario.' }));
|
||||
.then((_) => ({
|
||||
message:
|
||||
'Se creó correctamente tu cuenta, ingresa a tu correo institucional y consultar tu contraseña para este servicio.',
|
||||
}));
|
||||
}
|
||||
|
||||
update(attrs: Partial<Usuario>, validarPassword = true) {
|
||||
@@ -233,7 +229,7 @@ export class UsuarioService {
|
||||
return this.repository.save(usuario);
|
||||
})
|
||||
.then((_) => ({
|
||||
message: 'Se actualizó correctamente la información del usuario.',
|
||||
message: 'Se guardaron los cambios correctamente.',
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user