feat(ui): show total file count in FilesModal title (#25873)

This commit is contained in:
G30 authored and GitHub committed 2026-06-17 02:55:13 +02:00
1 parent 5cdcdbaeec
commit b4aef82401
4 files changed
+73 -2

No files matched your search

+28
View File
@@ -214,6 +214,34 @@ export const searchFiles = async (
return res;
};
export const getFileCount = async (token: string = '') => {
let error = null;
const res = await fetch(`${WEBUI_API_BASE_URL}/files/count`, {
method: 'GET',
headers: {
Accept: 'application/json',
'Content-Type': 'application/json',
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 getFileById = async (token: string, id: string) => {
let error = null;