Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into open-source
Browse files Browse the repository at this point in the history
  • Loading branch information
JeraldJF committed Jan 7, 2025
2 parents aef66dc + 793a9cf commit 06cff7c
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/main/controllers/user_list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,13 @@ export default {
try {
const user = _.get(request, ['body', 'request']);
const result = await userService.findAll(user);
const responseData = { data: result, count: _.size(result) };

const usersList = result.map((user: any) => {
const { password, provider, mobile_number, ...sanitizedUser } = user;
return sanitizedUser;
});

const responseData = { data: usersList, count: _.size(usersList) };
response.status(200).json(transform({ id: request.body.id, result: responseData }));
} catch (error) {
if (error === 'user_not_found') {
Expand All @@ -21,4 +27,4 @@ export default {
}
}
},
};
};

0 comments on commit 06cff7c

Please sign in to comment.