瀏覽代碼

fix(revisions): order by for identical created at date

Karol Sójko 1 年之前
父節點
當前提交
637593c1bc
共有 1 個文件被更改,包括 3 次插入0 次删除
  1. 3 0
      packages/revisions/src/Infra/TypeORM/MongoDB/MongoDBRevisionRepository.ts

+ 3 - 0
packages/revisions/src/Infra/TypeORM/MongoDB/MongoDBRevisionRepository.ts

@@ -46,6 +46,7 @@ export class MongoDBRevisionRepository implements RevisionRepositoryInterface {
       where: { userUuid: { $eq: dto.userUuid.value } },
       order: {
         createdAt: 'ASC',
+        _id: 'ASC',
       },
       skip: dto.offset,
       take: dto.limit,
@@ -146,6 +147,7 @@ export class MongoDBRevisionRepository implements RevisionRepositoryInterface {
         },
         order: {
           createdAt: 'DESC',
+          _id: 'DESC',
         },
       })
     } else {
@@ -156,6 +158,7 @@ export class MongoDBRevisionRepository implements RevisionRepositoryInterface {
         },
         order: {
           createdAt: 'DESC',
+          _id: 'DESC',
         },
       })
     }