From c2761162951d39abc75498d65c2d5a72f6c2ca95 Mon Sep 17 00:00:00 2001 From: TheManus88 Date: Wed, 2 Oct 2024 19:13:08 -0600 Subject: [PATCH] add admin type --- src/auth/auth.service.ts | 1 + src/users/users.service.ts | 10 ++++++++++ 2 files changed, 11 insertions(+) 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 + }); + } }