add admin type

This commit is contained in:
TheManus88
2024-10-02 19:13:08 -06:00
parent 35926405cc
commit c276116295
2 changed files with 11 additions and 0 deletions
+1
View File
@@ -20,6 +20,7 @@ export class AuthService {
switch (loginDto.tipo_usuario) {
case 1:
// Administrador
user = await this.usersService.findAdmin(loginDto);
break;
case 2:
// Alumno
+10
View File
@@ -40,4 +40,14 @@ export class UsersService {
rfc,
});
}
findAdmin(loginDto: LoginDTO): Promise<UsuarioEntity | null> {
const numero_identificacion = loginDto.numero_identificacion;
const rfc = loginDto.rfc;
return this.usersRepository.findOneBy({
numero_identificacion,
rfc,
tipo_usuario_id:1
});
}
}