mirror of https://github.com/langgenius/dify.git
refactor: simplify syncWorkflowDraft parameters by removing payload sanitization
This commit is contained in:
parent
440262a51b
commit
dfed14ba67
|
|
@ -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) => {
|
||||
|
|
|
|||
Loading…
Reference in New Issue