Browse Source

fix: ensure sorting by updatedAt in recent threads pagination

Shun Miyazawa 11 months ago
parent
commit
1082fa0e8f
1 changed files with 1 additions and 0 deletions
  1. 1 0
      apps/app/src/features/openai/server/routes/get-recent-threads.ts

+ 1 - 0
apps/app/src/features/openai/server/routes/get-recent-threads.ts

@@ -53,6 +53,7 @@ export const getRecentThreadsFactory: GetRecentThreadsFactory = (crowi) => {
           {
             page: req.query.page ?? 1,
             limit: req.query.limit ?? 10,
+            sort: { updatedAt: -1 },
           },
         );
         return res.apiv3({ paginateResult });