From 835baa6f4d7786024c384ba3df7bca506329c8b1 Mon Sep 17 00:00:00 2001 From: Janderson Souza Matias Date: Tue, 16 Jan 2024 11:32:08 -0300 Subject: [PATCH] adjust login on admin panel --- src/modules/user/service/index.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/modules/user/service/index.ts b/src/modules/user/service/index.ts index f813080..21cb7f3 100644 --- a/src/modules/user/service/index.ts +++ b/src/modules/user/service/index.ts @@ -32,7 +32,10 @@ export class UserService { static findUserByEmail = async (email: string): Promise => { const userRepository = dataSource.getRepository(User); - return userRepository.findOne({ where: { email } }); + return userRepository.findOne({ + where: { email }, + relations: { region: { parent: { parent: { parent: true } } } }, + }); }; static updateAdmin = async (