mirror of
https://github.com/documenso/documenso
synced 2026-04-21 13:27:18 +00:00
fix: admin org sorting (#2694)
This commit is contained in:
parent
4935f387bf
commit
bc82b2e70e
1 changed files with 5 additions and 3 deletions
|
|
@ -120,14 +120,16 @@ export const findAdminOrganisations = async ({
|
|||
};
|
||||
}
|
||||
|
||||
const orderBy: Prisma.OrganisationOrderByWithRelationInput[] = query
|
||||
? [{ subscription: { status: 'asc' } }, { name: 'asc' }]
|
||||
: [{ createdAt: 'desc' }];
|
||||
|
||||
const [data, count] = await Promise.all([
|
||||
prisma.organisation.findMany({
|
||||
where: whereClause,
|
||||
skip: Math.max(page - 1, 0) * perPage,
|
||||
take: perPage,
|
||||
orderBy: {
|
||||
createdAt: 'desc',
|
||||
},
|
||||
orderBy,
|
||||
select: {
|
||||
id: true,
|
||||
createdAt: true,
|
||||
|
|
|
|||
Loading…
Reference in a new issue