visuddhinanda 2 лет назад
Родитель
Сommit
efa02f3658
1 измененных файлов с 5 добавлено и 0 удалено
  1. 5 0
      dashboard/src/components/template/SentEdit/SuggestionList.tsx

+ 5 - 0
dashboard/src/components/template/SentEdit/SuggestionList.tsx

@@ -14,6 +14,7 @@ interface IWidget {
   channel: IChannel;
   channel: IChannel;
   reload?: boolean;
   reload?: boolean;
   onReload?: Function;
   onReload?: Function;
+  onChange?: Function;
 }
 }
 const SuggestionListWidget = ({
 const SuggestionListWidget = ({
   book,
   book,
@@ -23,6 +24,7 @@ const SuggestionListWidget = ({
   channel,
   channel,
   reload = false,
   reload = false,
   onReload,
   onReload,
+  onChange,
 }: IWidget) => {
 }: IWidget) => {
   const [sentData, setSentData] = useState<ISentence[]>([]);
   const [sentData, setSentData] = useState<ISentence[]>([]);
 
 
@@ -48,6 +50,9 @@ const SuggestionListWidget = ({
             };
             };
           });
           });
           setSentData(newData);
           setSentData(newData);
+          if (typeof onChange !== "undefined") {
+            onChange(json.data.count);
+          }
         } else {
         } else {
           message.error(json.message);
           message.error(json.message);
         }
         }