patch workspace-chats API endpoint to be generally available instead of forced multi-user

This commit is contained in:
timothycarambat 2024-01-02 12:44:17 -08:00
parent 2a1202de54
commit d99b87e7d8
3 changed files with 1 additions and 11 deletions
server
endpoints/api/admin
models
swagger

View file

@ -523,16 +523,9 @@ function apiAdminEndpoints(app) {
schema: {
"$ref": "#/definitions/InvalidAPIKey"
}
}
#swagger.responses[401] = {
description: "Instance is not in Multi-User mode. Method denied",
}
*/
try {
if (!multiUserMode(response)) {
response.sendStatus(401).end();
return;
}
const pgSize = 20;
const { offset = 0 } = reqBody(request);
const chats = await WorkspaceChats.whereWithData(

View file

@ -158,7 +158,7 @@ const WorkspaceChats = {
? { name: workspace.name, slug: workspace.slug }
: { name: "deleted workspace", slug: null };
const user = await User.get({ id: res.user_id });
const user = res.user_id ? await User.get({ id: res.user_id }) : null;
res.user = user
? { username: user.username }
: { username: "unknown user" };

View file

@ -665,9 +665,6 @@
}
}
},
"401": {
"description": "Instance is not in Multi-User mode. Method denied"
},
"403": {
"description": "Forbidden",
"content": {