add new conversation vars update api

This commit is contained in:
hjlarry
2025-09-10 09:24:22 +08:00
parent ab438b42da
commit d5fc3e7bed
4 changed files with 142 additions and 30 deletions

View File

@ -10,7 +10,7 @@ import type {
} from '@/types/workflow'
import type { BlockEnum } from '@/app/components/workflow/types'
import type { VarInInspect } from '@/types/workflow'
import type { EnvironmentVariable } from '@/app/components/workflow/types'
import type { ConversationVariable, EnvironmentVariable } from '@/app/components/workflow/types'
export const fetchWorkflowDraft = (url: string) => {
return get(url, {}, { silent: true }) as Promise<FetchWorkflowDraftResponse>
@ -115,3 +115,12 @@ export const updateEnvironmentVariables = ({ appId, environmentVariables }: {
body: { environment_variables: environmentVariables },
})
}
export const updateConversationVariables = ({ appId, conversationVariables }: {
appId: string
conversationVariables: ConversationVariable[]
}) => {
return post<CommonResponse>(`apps/${appId}/workflows/draft/conversation-variables`, {
body: { conversation_variables: conversationVariables },
})
}