Merge branch 'main' into litellm_ui_improvements_time_series

This commit is contained in:
Krish Dholakia 2024-02-09 20:54:36 -08:00 committed by GitHub
commit a8ef8e12bb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
23 changed files with 629 additions and 167 deletions

View file

@ -179,6 +179,12 @@ export const userSpendLogsCall = async (
url = `${url}/?start_date=${startTime}&end_date=${endTime}`;
}
const response = await fetch(url, {
export const spendUsersCall = async (accessToken: String, userID: String) => {
try {
const url = proxyBaseUrl ? `${proxyBaseUrl}/spend/users` : `/spend/users`;
console.log("in spendUsersCall:", url);
const response = await fetch(`${url}/?user_id=${userID}`, {
method: "GET",
headers: {
Authorization: `Bearer ${accessToken}`,
@ -195,7 +201,7 @@ export const userSpendLogsCall = async (
console.log(data);
return data;
} catch (error) {
console.error("Failed to create key:", error);
console.error("Failed to get spend for user", error);
throw error;
}
};