Skip to content

Commit

Permalink
fixing pagination logic
Browse files Browse the repository at this point in the history
  • Loading branch information
selfcontained committed Nov 8, 2023
1 parent df7929c commit 09d9d9e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion components/server/src/api/configuration-service-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ export class ConfigurationServiceAPI implements ServiceImpl<typeof Configuration
}

const limit = req.pagination?.pageSize || 25;
const offset = (req.pagination?.page ?? 0) * limit;
const currentPage = req.pagination?.page ?? 1;
const offset = currentPage > 1 ? currentPage * limit : 0;

const { rows, total } = await this.projectService.findProjects(context.user.id, {
searchTerm: req.searchTerm,
Expand Down

0 comments on commit 09d9d9e

Please sign in to comment.