feat(ui): add 'Unshare All Shared Chats' button to Shared Chats modal (#25848)
This commit is contained in:
5 files changed
+114
-3
No files matched your search
@@ -65,6 +65,38 @@ export const unarchiveAllChats = async (token: string) => {
|
||||
return res;
|
||||
};
|
||||
|
||||
export const unshareAllChats = async (token: string) => {
|
||||
let error = null;
|
||||
|
||||
const res = await fetch(`${WEBUI_API_BASE_URL}/chats/share/all`, {
|
||||
method: 'DELETE',
|
||||
headers: {
|
||||
Accept: 'application/json',
|
||||
'Content-Type': 'application/json',
|
||||
...(token && { authorization: `Bearer ${token}` })
|
||||
}
|
||||
})
|
||||
.then(async (res) => {
|
||||
if (!res.ok) throw await res.json();
|
||||
return res.json();
|
||||
})
|
||||
.then((json) => {
|
||||
return json;
|
||||
})
|
||||
.catch((err) => {
|
||||
error = err.detail;
|
||||
|
||||
console.error(err);
|
||||
return null;
|
||||
});
|
||||
|
||||
if (error) {
|
||||
throw error;
|
||||
}
|
||||
|
||||
return res;
|
||||
};
|
||||
|
||||
export const importChats = async (token: string, chats: object[]) => {
|
||||
let error = null;
|
||||
|
||||
|
||||
Reference in new issue
Block a user