mirror of
https://github.com/langgenius/dify.git
synced 2026-04-25 17:47:30 +08:00
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 { VarInInspect } from '@/types/workflow'
|
||||||
import type { FlowType } from '@/types/common'
|
import type { FlowType } from '@/types/common'
|
||||||
import { getFlowPrefix } from './utils'
|
import { getFlowPrefix } from './utils'
|
||||||
import { sanitizeWorkflowDraftPayload } from './workflow-payload'
|
|
||||||
import type { WorkflowDraftSyncParams } from './workflow-payload'
|
|
||||||
|
|
||||||
export const fetchWorkflowDraft = (url: string) => {
|
export const fetchWorkflowDraft = (url: string) => {
|
||||||
return get(url, {}, { silent: true }) as Promise<FetchWorkflowDraftResponse>
|
return get(url, {}, { silent: true }) as Promise<FetchWorkflowDraftResponse>
|
||||||
@ -21,10 +19,9 @@ export const fetchWorkflowDraft = (url: string) => {
|
|||||||
|
|
||||||
export const syncWorkflowDraft = ({ url, params }: {
|
export const syncWorkflowDraft = ({ url, params }: {
|
||||||
url: string
|
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: params }, { silent: true })
|
||||||
return post<CommonResponse & { updated_at: number; hash: string }>(url, { body: sanitizedParams }, { silent: true })
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export const fetchNodesDefaultConfigs: Fetcher<NodesDefaultConfigsResponse, string> = (url) => {
|
export const fetchNodesDefaultConfigs: Fetcher<NodesDefaultConfigsResponse, string> = (url) => {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user