forked from phoenix/litellm-mirror
(ui) - parse metadata
This commit is contained in:
parent
9233058141
commit
318a177d98
1 changed files with 11 additions and 0 deletions
|
@ -11,6 +11,17 @@ export const keyCreateCall = async (
|
|||
) => {
|
||||
try {
|
||||
console.log("Form Values in keyCreateCall:", formValues); // Log the form values before making the API call
|
||||
|
||||
// if formValues.metadata is not undefined, make it a valid dict
|
||||
if (formValues.metadata) {
|
||||
// if there's an exception JSON.parse, show it in the message
|
||||
try {
|
||||
formValues.metadata = JSON.parse(formValues.metadata);
|
||||
} catch (error) {
|
||||
message.error("Failed to parse metadata: " + error);
|
||||
}
|
||||
}
|
||||
|
||||
const response = await fetch(`${proxyBaseUrl}/key/generate`, {
|
||||
method: "POST",
|
||||
headers: {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue