Skip to content

Commit 2644661

Browse files
committed
deterministic order for getReports. Closes #4323
1 parent f09df3c commit 2644661

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/queries/prisma/report.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ export async function getReport(reportId: string) {
1818

1919
export async function getReports(criteria: ReportFindManyArgs, filters: QueryFilters = {}) {
2020
const { search } = filters;
21+
const orderBy = criteria.orderBy ?? [{ name: 'asc' }, { id: 'asc' }];
2122

2223
const where: Prisma.ReportWhereInput = {
2324
...criteria.where,
@@ -43,7 +44,7 @@ export async function getReports(criteria: ReportFindManyArgs, filters: QueryFil
4344
]),
4445
};
4546

46-
return prisma.pagedQuery('report', { ...criteria, where }, filters);
47+
return prisma.pagedQuery('report', { ...criteria, where, orderBy }, filters);
4748
}
4849

4950
export async function getUserReports(userId: string, filters?: QueryFilters) {

0 commit comments

Comments
 (0)