Skip to content

Commit

Permalink
remove default check
Browse files Browse the repository at this point in the history
  • Loading branch information
Chakravarthy7102 committed Nov 16, 2023
1 parent 62e26c7 commit 0b72990
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 17 deletions.
8 changes: 0 additions & 8 deletions lib/build/recipe/dashboard/api/userroles/roles/getAllRoles.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,6 @@ const getAllRoles = async (_, __, options, ____) => {
const response = await userroles_1.default.getAllRoles();
const totalPages = Math.ceil(response.roles.length / limit);
const totalRolesCount = response.roles.length;
if (page > totalPages) {
return {
status: "OK",
roles: [],
totalRolesCount,
totalPages,
};
}
//reversing the roles to show latest created roles at first.
const paginatedRoles = response.roles.reverse().slice(skip, skip + limit);
let roles = [];
Expand Down
9 changes: 0 additions & 9 deletions lib/ts/recipe/dashboard/api/userroles/roles/getAllRoles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,6 @@ const getAllRoles: APIFunction = async (
const totalPages = Math.ceil(response.roles.length / limit);
const totalRolesCount = response.roles.length;

if (page > totalPages) {
return {
status: "OK",
roles: [],
totalRolesCount,
totalPages,
};
}

//reversing the roles to show latest created roles at first.
const paginatedRoles = response.roles.reverse().slice(skip, skip + limit);

Expand Down

0 comments on commit 0b72990

Please sign in to comment.