Skip to content

Commit

Permalink
Merge pull request #16 from vishnuvinay89/all-saas-0.2-dev
Browse files Browse the repository at this point in the history
Count issue fix in user and cohort list
  • Loading branch information
sudeeppr1998 authored Jan 15, 2025
2 parents 04d9171 + 9e6fad4 commit f4dbaa8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions src/adapters/postgres/cohort-adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -649,9 +649,8 @@ export class PostgresCohortService {
}

// Apply offset and limit for pagination
count = results.length;
const paginatedResults = results.slice(offset, offset + limit);
count = paginatedResults.length;

if (paginatedResults.length > 0) {
return APIResponse.success(
response,
Expand Down
2 changes: 1 addition & 1 deletion src/adapters/postgres/user-adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -357,8 +357,8 @@ async searchUser(
await this.processUserDetails(userSearchDto, results);
}
}
results.getUserDetails = results.getUserDetails.slice(offset, offset + limit);
results.total_count = results.getUserDetails.length;
results.getUserDetails = results.getUserDetails.slice(offset, offset + limit);


return await APIResponse.success(response, apiId, results, HttpStatus.OK, 'User List fetched.');
Expand Down

0 comments on commit f4dbaa8

Please sign in to comment.