EditMembership: add Allowed Models multi-select field

This commit is contained in:
Ishaan Jaffer 2026-04-01 15:37:03 -07:00
parent 19b105b00d
commit 77ca095412

View file

@ -21,7 +21,7 @@ interface ModalConfig {
additionalFields?: Array<{
name: string;
label: string | React.ReactNode;
type: "input" | "select" | "numerical";
type: "input" | "select" | "numerical" | "multi-select";
options?: Array<{ label: string; value: string }>;
rules?: any[];
step?: number;
@ -65,6 +65,8 @@ const MemberModal = <T extends BaseMember>({
max_budget_in_team: (initialData as any).max_budget_in_team || null,
tpm_limit: (initialData as any).tpm_limit || null,
rpm_limit: (initialData as any).rpm_limit || null,
// Keep array values for multi-select fields
allowed_models: (initialData as any).allowed_models || [],
};
console.log("Setting form values:", formValues);
form.setFieldsValue(formValues);
@ -115,7 +117,7 @@ const MemberModal = <T extends BaseMember>({
const renderField = (field: {
name: string;
label: string | React.ReactNode;
type: "input" | "select" | "numerical";
type: "input" | "select" | "numerical" | "multi-select";
options?: Array<{ label: string; value: string }>;
rules?: any[];
step?: number;
@ -144,6 +146,15 @@ const MemberModal = <T extends BaseMember>({
))}
</Select>
);
case "multi-select":
return (
<Select
mode="multiple"
placeholder={field.placeholder || "Select options"}
options={field.options}
allowClear
/>
);
default:
return null;
}