Complete type defined. (#1200)

This commit is contained in:
Rhon Joe
2023-09-20 12:27:06 +08:00
committed by GitHub
parent 1367f34398
commit e65f9cb17a
4 changed files with 27 additions and 23 deletions

View File

@@ -14,6 +14,8 @@ import OpeningStatement from '@/app/components/app/configuration/features/chat-g
import GroupName from '@/app/components/app/configuration/base/group-name'
import Loading from '@/app/components/base/loading'
import Confirm from '@/app/components/base/confirm'
// type
import type { AutomaticRes } from '@/service/debug'
const noDataIcon = (
<svg width="56" height="56" viewBox="0 0 56 56" fill="none" xmlns="http://www.w3.org/2000/svg">
@@ -21,12 +23,6 @@ const noDataIcon = (
</svg>
)
export type AutomaticRes = {
prompt: string
variables: string[]
opening_statement: string
}
export type IGetAutomaticResProps = {
mode: AppType
isShow: boolean
@@ -98,7 +94,7 @@ const GetAutomaticRes: FC<IGetAutomaticResProps> = ({
audiences,
hoping_to_solve: hopingToSolve,
})
setRes(res as AutomaticRes)
setRes(res)
}
finally {
setLoadingFalse()
@@ -193,7 +189,7 @@ const GetAutomaticRes: FC<IGetAutomaticResProps> = ({
onClose={() => setShowConfirmOverwrite(false)}
onConfirm={() => {
setShowConfirmOverwrite(false)
onFinished(res as AutomaticRes)
onFinished(res!)
}}
onCancel={() => setShowConfirmOverwrite(false)}
/>