refactor: simplify syncWorkflowDraft parameters by removing payload sanitization

This commit is contained in:
zhsama 2025-10-27 13:46:27 +08:00
parent 440262a51b
commit dfed14ba67
1 changed files with 2 additions and 5 deletions

View File

@ -12,8 +12,6 @@ import type { BlockEnum } from '@/app/components/workflow/types'
import type { VarInInspect } from '@/types/workflow'
import type { FlowType } from '@/types/common'
import { getFlowPrefix } from './utils'
import { sanitizeWorkflowDraftPayload } from './workflow-payload'
import type { WorkflowDraftSyncParams } from './workflow-payload'
export const fetchWorkflowDraft = (url: string) => {
return get(url, {}, { silent: true }) as Promise<FetchWorkflowDraftResponse>
@ -21,10 +19,9 @@ export const fetchWorkflowDraft = (url: string) => {
export const syncWorkflowDraft = ({ url, params }: {
url: string
params: WorkflowDraftSyncParams
params: Pick<FetchWorkflowDraftResponse, 'graph' | 'features' | 'environment_variables' | 'conversation_variables'>
}) => {
const sanitizedParams = sanitizeWorkflowDraftPayload(params)
return post<CommonResponse & { updated_at: number; hash: string }>(url, { body: sanitizedParams }, { silent: true })
return post<CommonResponse & { updated_at: number; hash: string }>(url, { body: params }, { silent: true })
}
export const fetchNodesDefaultConfigs: Fetcher<NodesDefaultConfigsResponse, string> = (url) => {