feat(credential_accessor.py): fix upserting new credentials via accessor

This commit is contained in:
Krrish Dholakia 2025-03-12 19:03:37 -07:00
parent de1f94154b
commit d024a5d703
4 changed files with 45 additions and 24 deletions

View file

@ -2572,6 +2572,40 @@ export const credentialCreateCall = async (
}
};
export const credentialListCall = async (
accessToken: String,
) => {
/**
* Get all available teams on proxy
*/
try {
let url = proxyBaseUrl ? `${proxyBaseUrl}/credentials` : `/credentials`;
console.log("in credentialListCall");
const response = await fetch(url, {
method: "GET",
headers: {
[globalLitellmHeaderName]: `Bearer ${accessToken}`,
"Content-Type": "application/json",
},
});
if (!response.ok) {
const errorData = await response.text();
handleError(errorData);
throw new Error("Network response was not ok");
}
const data = await response.json();
console.log("/credentials API Response:", data);
return data;
// Handle success - you might want to update some state or UI based on the created key
} catch (error) {
console.error("Failed to create key:", error);
throw error;
}
};
export const keyUpdateCall = async (
accessToken: string,
formValues: Record<string, any> // Assuming formValues is an object