Skip to content

Commit f4dbaa8

Browse files
authored
Merge pull request #16 from vishnuvinay89/all-saas-0.2-dev
Count issue fix in user and cohort list
2 parents 04d9171 + 9e6fad4 commit f4dbaa8

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

src/adapters/postgres/cohort-adapter.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -649,9 +649,8 @@ export class PostgresCohortService {
649649
}
650650

651651
// Apply offset and limit for pagination
652+
count = results.length;
652653
const paginatedResults = results.slice(offset, offset + limit);
653-
count = paginatedResults.length;
654-
655654
if (paginatedResults.length > 0) {
656655
return APIResponse.success(
657656
response,

src/adapters/postgres/user-adapter.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,8 +357,8 @@ async searchUser(
357357
await this.processUserDetails(userSearchDto, results);
358358
}
359359
}
360-
results.getUserDetails = results.getUserDetails.slice(offset, offset + limit);
361360
results.total_count = results.getUserDetails.length;
361+
results.getUserDetails = results.getUserDetails.slice(offset, offset + limit);
362362

363363

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

0 commit comments

Comments
 (0)