temp fix: tab change caused empty the nodes

This commit is contained in:
Joel
2026-01-14 17:20:22 +08:00
parent d17a92f713
commit be5a4cf5e3
3 changed files with 32 additions and 8 deletions

View File

@ -19,6 +19,10 @@ export const syncWorkflowDraft = ({ url, params }: {
url: string
params: Pick<FetchWorkflowDraftResponse, 'graph' | 'features' | 'environment_variables' | 'conversation_variables'>
}) => {
// when graph adn skill type changed, it would pass empty nodes array...Temp prevent sync in this case
if (params.graph.nodes.length === 0) {
throw new Error('Cannot sync workflow draft with zero nodes.')
}
const sanitized = sanitizeWorkflowDraftPayload(params)
return post<CommonResponse & { updated_at: number, hash: string }>(url, { body: sanitized }, { silent: true })
}