(ui) - parse metadata

This commit is contained in:
ishaan-jaff 2024-02-01 09:30:49 -08:00
parent 9233058141
commit 318a177d98

View file

@ -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: {