Browse Source

Add id as secondary sort criterion to ensure consistent ordering

pull/3554/head
Thomas Kaul 1 year ago
parent
commit
d066f0b279
  1. 5
      apps/api/src/app/order/order.service.ts

5
apps/api/src/app/order/order.service.ts

@ -291,7 +291,8 @@ export class OrderService {
withExcludedAccounts?: boolean;
}): Promise<Activities> {
let orderBy: Prisma.Enumerable<Prisma.OrderOrderByWithRelationInput> = [
{ date: 'asc' }
{ date: 'asc' },
{ id: 'asc' }
];
const where: Prisma.OrderWhereInput = { userId };
@ -367,7 +368,7 @@ export class OrderService {
}
if (sortColumn) {
orderBy = [{ [sortColumn]: sortDirection }];
orderBy = [{ [sortColumn]: sortDirection }, { id: sortDirection }];
}
if (types) {

Loading…
Cancel
Save