From fd1e23127ebbc2a20417e7e88f1d7e64d1ac20d6 Mon Sep 17 00:00:00 2001 From: yassinedorbozgithub Date: Wed, 27 Nov 2024 06:37:19 +0100 Subject: [PATCH] fix: remove unused event prop --- .../src/app-components/inputs/NlpPatternSelect.tsx | 10 +++------- .../form/inputs/triggers/PatternInput.tsx | 4 +--- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/frontend/src/app-components/inputs/NlpPatternSelect.tsx b/frontend/src/app-components/inputs/NlpPatternSelect.tsx index e42e2ee..63b193b 100644 --- a/frontend/src/app-components/inputs/NlpPatternSelect.tsx +++ b/frontend/src/app-components/inputs/NlpPatternSelect.tsx @@ -32,10 +32,7 @@ import { INlpValue } from "@/types/nlp-value.types"; type NlpPatternSelectProps = { patterns: NlpPattern[]; - onChange: ( - _event: SyntheticEvent | undefined, - patterns: NlpPattern[], - ) => void; + onChange: (patterns: NlpPattern[]) => void; }; const NlpPatternSelect = ( @@ -76,7 +73,7 @@ const NlpPatternSelect = ( ), ]; - onChange(undefined, newSelection); + onChange(newSelection); }; const handleNlpValueChange = ( { id, name }: Pick, @@ -102,7 +99,7 @@ const NlpPatternSelect = ( update.value = value.value; } - onChange(undefined, newSelection); + onChange(newSelection); }; if (!options.length) { @@ -255,7 +252,6 @@ const NlpPatternSelect = ( onDelete(e); onChange( - undefined, patterns.filter((p) => p.entity !== name), ); }} diff --git a/frontend/src/components/visual-editor/form/inputs/triggers/PatternInput.tsx b/frontend/src/components/visual-editor/form/inputs/triggers/PatternInput.tsx index 5791f2d..0bab40f 100644 --- a/frontend/src/components/visual-editor/form/inputs/triggers/PatternInput.tsx +++ b/frontend/src/components/visual-editor/form/inputs/triggers/PatternInput.tsx @@ -148,9 +148,7 @@ const PatternInput: FC = ({ {patternType === "nlp" && ( { - setPattern(data); - }} + onChange={setPattern} /> )} {patternType === "menu" ? (