deterministic order for getReports. Closes #4323

This commit is contained in:
Francis Cao
2026-06-05 09:53:45 -07:00
parent f09df3cf14
commit 264466191e
+2 -1
View File
@@ -18,6 +18,7 @@ export async function getReport(reportId: string) {
export async function getReports(criteria: ReportFindManyArgs, filters: QueryFilters = {}) {
const { search } = filters;
const orderBy = criteria.orderBy ?? [{ name: 'asc' }, { id: 'asc' }];
const where: Prisma.ReportWhereInput = {
...criteria.where,
@@ -43,7 +44,7 @@ export async function getReports(criteria: ReportFindManyArgs, filters: QueryFil
]),
};
return prisma.pagedQuery('report', { ...criteria, where }, filters);
return prisma.pagedQuery('report', { ...criteria, where, orderBy }, filters);
}
export async function getUserReports(userId: string, filters?: QueryFilters) {