Skip to content

Commit

Permalink
Merge pull request #1513 from bcgov/fix/hamed-pagination-user-table-1430
Browse files Browse the repository at this point in the history
Fix: Correct Pagination for User Table Filter - 1430
  • Loading branch information
hamed-valiollahi authored Dec 20, 2024
2 parents a98abf4 + 5b9ac63 commit 30d75c4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions backend/lcfs/web/api/user/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,14 +125,14 @@ async def get_all_users(self, pagination: PaginationRequestSchema) -> UsersSchem
Get all users
"""
users, total_count = await self.repo.get_users_paginated(pagination=pagination)
if len(users) == 0:
raise DataNotFoundException("No users found")
return UsersSchema(
pagination=PaginationResponseSchema(
total=total_count,
page=pagination.page,
size=pagination.size,
total_pages=math.ceil(total_count / pagination.size),
total_pages=(
math.ceil(total_count / pagination.size) if total_count > 0 else 0
),
),
users=users,
)
Expand Down

0 comments on commit 30d75c4

Please sign in to comment.