From 3430d61ef5f7f4709d9193c3ce72d91b089192e9 Mon Sep 17 00:00:00 2001
From: Renzo Beux <renzobeux@gmail.com>
Date: Sun, 24 Oct 2021 23:03:18 -0300
Subject: [PATCH] refactor to debug better

---
 src/Services/UserService.ts | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/src/Services/UserService.ts b/src/Services/UserService.ts
index 41bf86b..a361287 100644
--- a/src/Services/UserService.ts
+++ b/src/Services/UserService.ts
@@ -418,12 +418,15 @@ const login = async (userDTO: UserLoginDTO): Promise<User> => User.findOne({
   throw new Error('find user error');
 });
 
-const listUsersById = async (ids: number[]): Promise<User[]> => User.findAll({
-  attributes: [
-    'id', 'name', 'email', 'organization', 'type',
-  ],
-  where: { id: { [Op.in]: ids } },
-});
+const listUsersById = async (ids: number[]): Promise<User[]> => {
+  const users = User.findAll({
+    attributes: [
+      'id', 'name', 'email', 'organization', 'type',
+    ],
+    where: { id: { [Op.in]: ids } },
+  });
+  return users;
+};
 
 export default {
   listAll,
-- 
GitLab