This commit is contained in:
Timothy Jaeryang Baek
2026-02-09 13:28:21 -06:00
parent f7406ff576
commit 3c7f9aa6a4
27 changed files with 789 additions and 253 deletions
+27
View File
@@ -327,6 +327,33 @@ export const getUserById = async (token: string, userId: string) => {
return res;
};
export const getUserInfoById = async (token: string, userId: string) => {
let error = null;
const res = await fetch(`${WEBUI_API_BASE_URL}/users/${userId}/info`, {
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.error(err);
error = err.detail;
return null;
});
if (error) {
throw error;
}
return res;
};
export const updateUserStatus = async (token: string, formData: object) => {
let error = null;