diff --git a/client/src/components/dynamic-groups/rule-editor.tsx b/client/src/components/dynamic-groups/rule-editor.tsx index 7bdf810..d861d19 100644 --- a/client/src/components/dynamic-groups/rule-editor.tsx +++ b/client/src/components/dynamic-groups/rule-editor.tsx @@ -42,11 +42,16 @@ export interface Condition { } interface RuleEditorProps { - rule?: DynamicGroupRule; + rule?: DynamicGroupRule & { connectionIds?: number[] }; onSave: (rule: DynamicGroupRule, schedules: ScheduleItem[]) => void; onCancel: () => void; } +// Extend the DynamicGroupRule type to include connectionIds for frontend use +interface ExtendedDynamicGroupRule extends DynamicGroupRule { + connectionIds?: number[]; +} + export const RuleEditor: React.FC = ({ rule, onSave, onCancel }) => { const { toast } = useToast(); const [activeTab, setActiveTab] = useState('general'); @@ -232,8 +237,8 @@ export const RuleEditor: React.FC = ({ rule, onSave, onCancel } const targetGroupDN = getTargetGroupDN(); - const ruleData: DynamicGroupRule = { - id: rule?.id, + const ruleData: ExtendedDynamicGroupRule = { + id: rule?.id || 0, // Default to 0 for new records name: formData.name, description: formData.description || null, targetGroup: targetGroupDN,