diff --git a/src/auth/auth.service.ts b/src/auth/auth.service.ts index b7d6579..ae3346e 100644 --- a/src/auth/auth.service.ts +++ b/src/auth/auth.service.ts @@ -20,6 +20,7 @@ export class AuthService { switch (loginDto.tipo_usuario) { case 1: // Administrador + user = await this.usersService.findAdmin(loginDto); break; case 2: // Alumno diff --git a/src/users/users.service.ts b/src/users/users.service.ts index 96bd2ec..fa40c2e 100644 --- a/src/users/users.service.ts +++ b/src/users/users.service.ts @@ -40,4 +40,14 @@ export class UsersService { rfc, }); } + + findAdmin(loginDto: LoginDTO): Promise { + const numero_identificacion = loginDto.numero_identificacion; + const rfc = loginDto.rfc; + return this.usersRepository.findOneBy({ + numero_identificacion, + rfc, + tipo_usuario_id:1 + }); + } }