diff --git a/CHANGELOG.md b/CHANGELOG.md index e62dc95b5..c322a4c6b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Improved the language localization for German (`de`) +### Fixed + +- Fixed a pagination issue in the activities endpoint by adding `id` as a secondary sort criterion to `date` to ensure consistent ordering + ## 2.93.0 - 2024-07-07 ### Added diff --git a/apps/api/src/app/order/order.service.ts b/apps/api/src/app/order/order.service.ts index a1fa4db6c..0255a5011 100644 --- a/apps/api/src/app/order/order.service.ts +++ b/apps/api/src/app/order/order.service.ts @@ -291,7 +291,8 @@ export class OrderService { withExcludedAccounts?: boolean; }): Promise { let orderBy: Prisma.Enumerable = [ - { 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) {