mirror of
https://github.com/aljazceru/goose.git
synced 2025-12-20 15:44:25 +01:00
fix: missing field in request (#956)
This commit is contained in:
@@ -215,8 +215,12 @@ pub async fn configure_provider_dialog() -> Result<bool, Box<dyn Error>> {
|
||||
.mask('▪')
|
||||
.interact()?
|
||||
} else {
|
||||
cliclack::input(format!("Enter new value for {}", key.name))
|
||||
.interact()?
|
||||
let mut input =
|
||||
cliclack::input(format!("Enter new value for {}", key.name));
|
||||
if key.default.is_some() {
|
||||
input = input.default_input(&key.default.clone().unwrap());
|
||||
}
|
||||
input.interact()?
|
||||
};
|
||||
|
||||
if key.secret {
|
||||
|
||||
@@ -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