fix(ui): AntdSelect null value warning in AddModelForm credential picker

Ant Design Select does not accept null as an option value.
Change { value: null, label: "None" } → { value: "", label: "None" }
and remove initialValue={null} from the Form.Item (no initial selection
is correctly represented by undefined, not null). The submit handler
already deletes litellm_credential_name from params when absent, so
the empty string is handled safely.

Co-Authored-By: Claude Sonnet 4 (1M context) <noreply@anthropic.com>
This commit is contained in:
Bytechoreographer 2026-04-16 16:49:30 +08:00
parent 1dc0a2afa1
commit 2a320b98a6

View file

@ -234,14 +234,14 @@ const AddModelForm: React.FC<AddModelFormProps> = ({
</Typography.Text>
</div>
<Form.Item label="Existing Credentials" name="litellm_credential_name" initialValue={null}>
<Form.Item label="Existing Credentials" name="litellm_credential_name">
<AntdSelect
showSearch
placeholder="Select or search for existing credentials"
optionFilterProp="children"
filterOption={(input, option) => (option?.label ?? "").toLowerCase().includes(input.toLowerCase())}
options={[
{ value: null, label: "None" },
{ value: "", label: "None" },
...credentials.map((credential) => ({
value: credential.credential_name,
label: credential.credential_name,