feat(ui): show total archived chat count in ChatsModal title (#25872)

This commit is contained in:
G30
2026-06-17 02:57:27 +02:00
committed by GitHub
parent e031fadc35
commit dee07d8a30
5 changed files with 75 additions and 3 deletions
+28
View File
@@ -255,6 +255,34 @@ export const getArchivedChatList = async (
}));
};
export const getArchivedChatCount = async (token: string = '') => {
let error = null;
const res = await fetch(`${WEBUI_API_BASE_URL}/chats/archived/count`, {
method: 'GET',
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();
})
.catch((err) => {
error = err;
console.error(err);
return null;
});
if (error) {
throw error;
}
return res;
};
export const getSharedChatList = async (token: string = '', page: number = 1, filter?: object) => {
let error = null;