CzRger hai 2 meses
pai
achega
eb9fd1f463

+ 4 - 5
web/app/components/skill/intent/detail-modal.tsx

@@ -4,8 +4,7 @@ import { RiCloseLine } from '@remixicon/react'
 import Modal from '@/app/components/base/modal'
 import Button from '@/app/components/base/button'
 import {
-  addIntent, addIntentKeyword, delBatchIntentKeyword, editIntentKeyword,
-  editIntentType, fetchIntentKeyword,
+  addIntent, addIntentKeyword, delBatchIntentKeyword, editIntent, editIntentKeyword, fetchIntentKeyword,
   fetchIntentType, getIntent,
 } from '@/service/common'
 import 'react-multi-email/dist/style.css'
@@ -145,7 +144,7 @@ const DetailModal = ({
         })
       }
       else {
-        res = await editIntentType({
+        res = await editIntent({
           url: `/intentions/${transfer.row.id}`,
           body: { type_id: intentType, name: intentName },
         })
@@ -306,10 +305,10 @@ const DetailModal = ({
                 </div>
                 <div className="flex h-[150px] flex-col gap-2 overflow-y-auto border-2 border-solid border-[#F6F8FC] p-2">
                   {
-                    corpusList.filter((v: any) => !corpusFilter || v.name.includes(corpusFilter)).map((item: any) => (
+                    corpusList.filter((v: any) => !corpusFilter || v.question.includes(corpusFilter)).map((item: any) => (
                       <div key={item.id} className="flex items-center">
                         <div className="flex-1">
-                          {item.name}
+                          {item.question}
                         </div>
                       </div>
                     ))

+ 2 - 2
web/app/components/skill/intent/type-modal.tsx

@@ -3,7 +3,7 @@ import React, { useEffect, useState } from 'react'
 import { RiAddLine, RiCloseLine, RiRefreshLine, RiSearchLine } from '@remixicon/react'
 import Modal from '@/app/components/base/modal'
 import Button from '@/app/components/base/button'
-import { addIntentType, delCorpus, editIntentType, fetchIntentType } from '@/service/common'
+import { addIntentType, delIntentType, editIntentType, fetchIntentType } from '@/service/common'
 import 'react-multi-email/dist/style.css'
 import Input from '@/app/components/base/input'
 import useSWR from 'swr'
@@ -55,7 +55,7 @@ const TypeModal = ({
   const [row, setRow] = useState<any>({})
   const handleDel = async () => {
     try {
-      await delCorpus({
+      await delIntentType({
         url: `/intentions/types/${row.id}`,
         body: {},
       })