diff --git a/lib/build/recipe/dashboard/api/userroles/roles/getAllRoles.js b/lib/build/recipe/dashboard/api/userroles/roles/getAllRoles.js index cf3c75a7f..225492f61 100644 --- a/lib/build/recipe/dashboard/api/userroles/roles/getAllRoles.js +++ b/lib/build/recipe/dashboard/api/userroles/roles/getAllRoles.js @@ -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 = []; diff --git a/lib/ts/recipe/dashboard/api/userroles/roles/getAllRoles.ts b/lib/ts/recipe/dashboard/api/userroles/roles/getAllRoles.ts index 1bfd573f6..238c64984 100644 --- a/lib/ts/recipe/dashboard/api/userroles/roles/getAllRoles.ts +++ b/lib/ts/recipe/dashboard/api/userroles/roles/getAllRoles.ts @@ -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);