fix: missing field in request (#956)
This commit is contained in:
@@ -86,6 +86,8 @@ export function ConfigureProvidersGrid() {
|
||||
return;
|
||||
}
|
||||
|
||||
const isSecret = isSecretKey(keyName);
|
||||
|
||||
try {
|
||||
// Delete existing key if provider is already configured
|
||||
const isUpdate = providers.find((p) => p.id === selectedForSetup)?.isConfigured;
|
||||
@@ -96,7 +98,10 @@ export function ConfigureProvidersGrid() {
|
||||
'Content-Type': 'application/json',
|
||||
'X-Secret-Key': getSecretKey(),
|
||||
},
|
||||
body: JSON.stringify({ key: keyName }),
|
||||
body: JSON.stringify({
|
||||
key: keyName,
|
||||
isSecret,
|
||||
}),
|
||||
});
|
||||
|
||||
if (!deleteResponse.ok) {
|
||||
@@ -107,7 +112,6 @@ export function ConfigureProvidersGrid() {
|
||||
}
|
||||
|
||||
// Store new key
|
||||
const isSecret = isSecretKey(keyName);
|
||||
const storeResponse = await fetch(getApiUrl('/configs/store'), {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
|
||||
@@ -81,6 +81,7 @@ export function ProviderGrid({ onSubmit }: ProviderGridProps) {
|
||||
return;
|
||||
}
|
||||
|
||||
const isSecret = isSecretKey(keyName);
|
||||
try {
|
||||
if (selectedId && providers.find((p) => p.id === selectedId)?.isConfigured) {
|
||||
const deleteResponse = await fetch(getApiUrl('/configs/delete'), {
|
||||
@@ -89,7 +90,10 @@ export function ProviderGrid({ onSubmit }: ProviderGridProps) {
|
||||
'Content-Type': 'application/json',
|
||||
'X-Secret-Key': getSecretKey(),
|
||||
},
|
||||
body: JSON.stringify({ key: keyName }),
|
||||
body: JSON.stringify({
|
||||
key: keyName,
|
||||
isSecret,
|
||||
}),
|
||||
});
|
||||
|
||||
if (!deleteResponse.ok) {
|
||||
@@ -99,7 +103,6 @@ export function ProviderGrid({ onSubmit }: ProviderGridProps) {
|
||||
}
|
||||
}
|
||||
|
||||
const isSecret = isSecretKey(keyName);
|
||||
const storeResponse = await fetch(getApiUrl('/configs/store'), {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
|
||||
Reference in New Issue
Block a user