Update hidden credential_type input logic in EditModelModal

The hidden input for credential_type now prioritizes cost.credential_type, then provider.default_credential_type, and defaults to 'api_key' if neither is set. This ensures the correct credential type is submitted based on available data.
This commit is contained in:
Bentlybro
2026-01-16 14:29:46 +00:00
parent 386eea741c
commit cfb1613877

View File

@@ -186,7 +186,11 @@ export function EditModelModal({
</label>
</div>
{/* Hidden defaults for credential_type and unit */}
<input type="hidden" name="credential_type" value="api_key" />
<input
type="hidden"
name="credential_type"
value={cost?.credential_type ?? provider?.default_credential_type ?? "api_key"}
/>
<input type="hidden" name="unit" value={cost?.unit ?? "RUN"} />
<Dialog.Footer>