Skip to content

Commit

Permalink
Add metadata into getUsers route.
Browse files Browse the repository at this point in the history
  • Loading branch information
HranikBs23 committed Feb 23, 2022
1 parent 655b2ab commit 4e8b1a8
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/modules/platform/user/user.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -224,12 +224,14 @@ async function getUsers(req, res) {
const totalUser = countByUser.length;

const data = {
users: users,
page: page + 1,
limit: limit,
total: totalUser,
start: limit * page + 1,
end: offset + limit > totalUser ? totalUser : offset + limit,
users,
metaData: {
page: page + 1,
limit: limit,
total: totalUser,
start: limit * page + 1,
end: offset + limit > totalUser ? totalUser : offset + limit,
}
};

res.status(200).send(data);
Expand Down

0 comments on commit 4e8b1a8

Please sign in to comment.