deterministic order for getReports. Closes #4323
This commit is contained in:
1 parent
f09df3cf14
commit
264466191e
1 file changed
+2
-1
@@ -18,6 +18,7 @@ export async function getReport(reportId: string) {
|
|||||||
|
|
||||||
export async function getReports(criteria: ReportFindManyArgs, filters: QueryFilters = {}) {
|
export async function getReports(criteria: ReportFindManyArgs, filters: QueryFilters = {}) {
|
||||||
const { search } = filters;
|
const { search } = filters;
|
||||||
|
const orderBy = criteria.orderBy ?? [{ name: 'asc' }, { id: 'asc' }];
|
||||||
|
|
||||||
const where: Prisma.ReportWhereInput = {
|
const where: Prisma.ReportWhereInput = {
|
||||||
...criteria.where,
|
...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) {
|
export async function getUserReports(userId: string, filters?: QueryFilters) {
|
||||||
|
|||||||
Reference in new issue
Block a user