visuddhinanda 2 лет назад
Родитель
Сommit
9bf02f0ba2
1 измененных файлов с 10 добавлено и 8 удалено
  1. 10 8
      dashboard/src/components/channel/ChannelSentDiff.tsx

+ 10 - 8
dashboard/src/components/channel/ChannelSentDiff.tsx

@@ -182,14 +182,15 @@ const ChannelSentDiffWidget = ({
             if (typeof submitData === "undefined") {
             if (typeof submitData === "undefined") {
               return;
               return;
             }
             }
-            post<ISentenceNewRequest, ISentenceNewMultiResponse>(
-              `/v2/sentence`,
-              {
-                sentences: submitData,
-                channel: destChannel?.id,
-                copy: true,
-              }
-            )
+            const url = `/v2/sentence`;
+            const postData = {
+              sentences: submitData,
+              channel: destChannel?.id,
+              copy: true,
+              fork_from: srcChannel.id,
+            };
+            console.debug("fork post", url, postData);
+            post<ISentenceNewRequest, ISentenceNewMultiResponse>(url, postData)
               .then((json) => {
               .then((json) => {
                 if (json.ok) {
                 if (json.ok) {
                   if (typeof onSubmit !== "undefined") {
                   if (typeof onSubmit !== "undefined") {
@@ -201,6 +202,7 @@ const ChannelSentDiffWidget = ({
               })
               })
               .catch((e) => {
               .catch((e) => {
                 console.log(e);
                 console.log(e);
+                message.error("error");
               })
               })
               .finally(() => {
               .finally(() => {
                 setLoading(false);
                 setLoading(false);