This commit is contained in:
Timothy Jaeryang Baek
2025-04-30 16:58:38 +04:00
parent c1fa989cb8
commit 783d409b1d
2 changed files with 50 additions and 5 deletions

View File

@@ -166,6 +166,34 @@ export const getUsers = async (
return res;
};
export const getAllUsers = async (token: string) => {
let error = null;
let res = null;
res = await fetch(`${WEBUI_API_BASE_URL}/users/all`, {
method: 'GET',
headers: {
'Content-Type': 'application/json',
Authorization: `Bearer ${token}`
}
})
.then(async (res) => {
if (!res.ok) throw await res.json();
return res.json();
})
.catch((err) => {
console.log(err);
error = err.detail;
return null;
});
if (error) {
throw error;
}
return res;
};
export const getUserSettings = async (token: string) => {
let error = null;
const res = await fetch(`${WEBUI_API_BASE_URL}/users/user/settings`, {