fix pagination issue where user is not part of any space

This commit is contained in:
Philipinho
2025-04-07 19:09:02 +01:00
parent 06270ff747
commit 3559358d14
3 changed files with 15 additions and 6 deletions
@@ -221,7 +221,7 @@ export class SpaceMemberRepo {
let query = this.db
.selectFrom('spaces')
.selectAll('spaces')
.selectAll()
.select((eb) => [this.spaceRepo.withMemberCount(eb)])
//.where('workspaceId', '=', workspaceId)
.where('id', 'in', userSpaceIds)
@@ -237,9 +237,12 @@ export class SpaceMemberRepo {
);
}
const hasEmptyIds = userSpaceIds.length === 0;
const result = executeWithPagination(query, {
page: pagination.page,
perPage: pagination.limit,
hasEmptyIds,
});
return result;