Normalize chat sorting defaults in developer API (#3270)
* normalize sorting for workspace and workspace thread chats in dev api * lint --------- Co-authored-by: Timothy Carambat <rambat1010@gmail.com>
This commit is contained in:
parent
12b43256a0
commit
e53ec1474e
@ -411,7 +411,7 @@ function apiWorkspaceEndpoints(app) {
|
||||
const {
|
||||
apiSessionId = null,
|
||||
limit = 100,
|
||||
orderBy = "desc",
|
||||
orderBy = "asc",
|
||||
} = request.query;
|
||||
const workspace = await Workspace.get({ slug });
|
||||
|
||||
@ -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(
|
||||
|
||||
Loading…
Reference in New Issue
Block a user