Se agregó módulo de sistemas

This commit is contained in:
2025-04-09 11:10:28 -06:00
parent 38ea46c8ad
commit 1895e29cf2
13 changed files with 220 additions and 10 deletions
+6 -6
View File
@@ -30,24 +30,24 @@ export class MailController {
@Post('send')
@ApiSendMail()
async sendMail(
@Headers() headers:{password:string},
@Headers() headers:{token:string},
@Body() body: { to: string; subject: string; text: string; fecha_recibido: Date, html:string, adjuntos:any }) {
/*
// esta parte hay que rehacerla, se tiene que obtener la contraseña del sistema en base a la clave del sistema.
// debe de existir un modulo para crear contraseñas para las apis y administrar esas contraseñas
if (!headers.password) {
if (!headers.token) {
throw new UnauthorizedException('Header "Password" es requerido');
}
const sistem = await this.sistemaRepository.findOne({ where: { password: headers.password } });
const sistem = await this.sistemaRepository.findOne({ where: { token: headers.token } });
if (!sistem) {
throw new UnauthorizedException('Password incorrecto');
} */
}
@@ -73,7 +73,7 @@ export class MailController {
throw new UnauthorizedException('Header "Password" es requerido');
}
const sistem = await this.sistemaRepository.findOne({ where: { password: headers.password } });
const sistem = await this.sistemaRepository.findOne({ where: { token: headers.password } });
if (!sistem) {
throw new UnauthorizedException('Password incorrecto');