Skip to content

Commit

Permalink
feat: TM-1826 fix user pagination
Browse files Browse the repository at this point in the history
Signed-off-by: Matthieu <[email protected]>
  • Loading branch information
mtlmatt committed Sep 27, 2024
1 parent 81d6570 commit 5f63cee
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions le-taxi-api-node.js/src/features/users/user.constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ export const getUsersByRole = `SELECT
INNER JOIN roles_users ru ON ru.user_id = u.id
INNER JOIN role r ON ru.role_id = r.id
WHERE r.name = $1::text
AND u.active = true;
`;

export const getUsersPaginated = `SELECT
Expand Down Expand Up @@ -217,6 +218,7 @@ export const getUsersPaginated = `SELECT
FROM public."user" u
LEFT OUTER JOIN public.roles_users ru ON ru.user_id = u.id
LEFT OUTER JOIN public.role r ON r.id = ru.role_id
WHERE u.active = true
%ORDER_BY_CLAUSE%
LIMIT $2::int
OFFSET ($1::int * $2::int);
Expand Down

0 comments on commit 5f63cee

Please sign in to comment.