diff --git a/src/discounts/components/DiscountRules/componenets/RuleForm/RuleForm.tsx b/src/discounts/components/DiscountRules/componenets/RuleForm/RuleForm.tsx index bb5b58eaf9..12446937dd 100644 --- a/src/discounts/components/DiscountRules/componenets/RuleForm/RuleForm.tsx +++ b/src/discounts/components/DiscountRules/componenets/RuleForm/RuleForm.tsx @@ -61,7 +61,14 @@ export const RuleForm = ({ errors, openPlayground }: RuleFormProps { + const handleChannelChange = (e: ChangeEvent) => { + const channelId = e.target.value; + const channel = channels.find(channel => channel.id === channelId); + + if (channel) { + channelfield.onChange({ value: channel.id, label: channel.name }); + } + setValue("rewardGifts", []); // Restart conditions when catalog promotion @@ -70,15 +77,6 @@ export const RuleForm = ({ errors, openPlayground }: RuleFormProps { - const channelId = e.target.value; - const channel = channels.find(channel => channel.id === channelId); - - if (channel) { - channelfield.onChange({ value: channel.id, label: channel.name }); - } }; return (