From 17ec2f4ac5c4a6b04c806d474df4f613b9edd722 Mon Sep 17 00:00:00 2001 From: Philipinho <16838612+Philipinho@users.noreply.github.com> Date: Mon, 2 Mar 2026 21:07:47 +0000 Subject: [PATCH] lists sorting --- apps/server/src/database/repos/group/group.repo.ts | 2 ++ apps/server/src/database/repos/space/space-member.repo.ts | 7 +++++-- apps/server/src/database/repos/space/space.repo.ts | 7 +++++-- apps/server/src/database/repos/user/user.repo.ts | 7 +++++-- 4 files changed, 17 insertions(+), 6 deletions(-) diff --git a/apps/server/src/database/repos/group/group.repo.ts b/apps/server/src/database/repos/group/group.repo.ts index 3a44e6c3..3b8c1ea7 100644 --- a/apps/server/src/database/repos/group/group.repo.ts +++ b/apps/server/src/database/repos/group/group.repo.ts @@ -135,10 +135,12 @@ export class GroupRepo { direction: 'desc', key: 'memberCount', }, + { expression: 'sub.name', direction: 'asc', key: 'name' }, { expression: 'sub.id', direction: 'asc', key: 'id' }, ], parseCursor: (cursor) => ({ memberCount: parseInt(cursor.memberCount, 10), + name: cursor.name, id: cursor.id, }), }); diff --git a/apps/server/src/database/repos/space/space-member.repo.ts b/apps/server/src/database/repos/space/space-member.repo.ts index 5cace3e0..fb406ecd 100644 --- a/apps/server/src/database/repos/space/space-member.repo.ts +++ b/apps/server/src/database/repos/space/space-member.repo.ts @@ -304,8 +304,11 @@ export class SpaceMemberRepo { perPage: pagination.limit, cursor: pagination.cursor, beforeCursor: pagination.beforeCursor, - fields: [{ expression: 'id', direction: 'asc' }], - parseCursor: (cursor) => ({ id: cursor.id }), + fields: [ + { expression: 'name', direction: 'asc' }, + { expression: 'id', direction: 'asc' }, + ], + parseCursor: (cursor) => ({ name: cursor.name, id: cursor.id }), }); } } diff --git a/apps/server/src/database/repos/space/space.repo.ts b/apps/server/src/database/repos/space/space.repo.ts index 8344a557..8ec5904c 100644 --- a/apps/server/src/database/repos/space/space.repo.ts +++ b/apps/server/src/database/repos/space/space.repo.ts @@ -152,8 +152,11 @@ export class SpaceRepo { perPage: pagination.limit, cursor: pagination.cursor, beforeCursor: pagination.beforeCursor, - fields: [{ expression: 'id', direction: 'asc' }], - parseCursor: (cursor) => ({ id: cursor.id }), + fields: [ + { expression: 'name', direction: 'asc' }, + { expression: 'id', direction: 'asc' }, + ], + parseCursor: (cursor) => ({ name: cursor.name, id: cursor.id }), }); } diff --git a/apps/server/src/database/repos/user/user.repo.ts b/apps/server/src/database/repos/user/user.repo.ts index 3545e7ec..c3903357 100644 --- a/apps/server/src/database/repos/user/user.repo.ts +++ b/apps/server/src/database/repos/user/user.repo.ts @@ -165,8 +165,11 @@ export class UserRepo { perPage: pagination.limit, cursor: pagination.cursor, beforeCursor: pagination.beforeCursor, - fields: [{ expression: 'id', direction: 'asc' }], - parseCursor: (cursor) => ({ id: cursor.id }), + fields: [ + { expression: 'name', direction: 'asc' }, + { expression: 'id', direction: 'asc' }, + ], + parseCursor: (cursor) => ({ name: cursor.name, id: cursor.id }), }); }