mirror of
https://github.com/Mintplex-Labs/anything-llm.git
synced 2025-04-17 18:18:11 +00:00
patch workspace-chats API endpoint to be generally available instead of forced multi-user
This commit is contained in:
parent
2a1202de54
commit
d99b87e7d8
3 changed files with 1 additions and 11 deletions
server
|
@ -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(
|
||||
|
|
|
@ -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" };
|
||||
|
|
|
@ -665,9 +665,6 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"401": {
|
||||
"description": "Instance is not in Multi-User mode. Method denied"
|
||||
},
|
||||
"403": {
|
||||
"description": "Forbidden",
|
||||
"content": {
|
||||
|
|
Loading…
Add table
Reference in a new issue