Skip to content

Commit

Permalink
Normalize chat sorting defaults in developer API (#3270)
Browse files Browse the repository at this point in the history
* normalize sorting for workspace and workspace thread chats in dev api

* lint

---------

Co-authored-by: Timothy Carambat <[email protected]>
  • Loading branch information
shatfield4 and timothycarambat authored Feb 19, 2025
1 parent 12b4325 commit e53ec14
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions server/endpoints/api/workspace/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ function apiWorkspaceEndpoints(app) {
const {
apiSessionId = null,
limit = 100,
orderBy = "desc",
orderBy = "asc",
} = request.query;
const workspace = await Workspace.get({ slug });

Expand All @@ -423,7 +423,7 @@ function apiWorkspaceEndpoints(app) {
const validLimit = Math.max(1, parseInt(limit));
const validOrderBy = ["asc", "desc"].includes(orderBy)
? orderBy
: "desc";
: "asc";

const history = apiSessionId
? await WorkspaceChats.forWorkspaceByApiSessionId(
Expand Down

0 comments on commit e53ec14

Please sign in to comment.