Skip to content

Commit ff561ec

Browse files
committed
fix(api): preserve fork policy in workflow detail
1 parent a5dda7c commit ff561ec

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

apps/sim/lib/api/contracts/workflows.test.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { describe, expect, it } from 'vitest'
22
import {
33
executeWorkflowBodySchema,
4+
getWorkflowResponseDataSchema,
45
updateWorkflowBodySchema,
56
workflowListItemSchema,
67
} from '@/lib/api/contracts/workflows'
@@ -119,4 +120,11 @@ describe('workflow contracts', () => {
119120
})
120121
expect(item.forkSyncExcluded).toBe(false)
121122
})
123+
124+
it('detail response preserves forkSyncExcluded and defaults old responses', () => {
125+
const forkPolicySchema = getWorkflowResponseDataSchema.pick({ forkSyncExcluded: true })
126+
127+
expect(forkPolicySchema.parse({ forkSyncExcluded: true }).forkSyncExcluded).toBe(true)
128+
expect(forkPolicySchema.parse({}).forkSyncExcluded).toBe(false)
129+
})
122130
})

apps/sim/lib/api/contracts/workflows.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -743,6 +743,7 @@ export const getWorkflowResponseDataSchema = z.object({
743743
deployedAt: z.coerce.date().nullable(),
744744
isPublicApi: z.boolean(),
745745
locked: z.boolean(),
746+
forkSyncExcluded: z.boolean().default(false),
746747
runCount: z.number(),
747748
lastRunAt: z.coerce.date().nullable(),
748749
archivedAt: z.coerce.date().nullable(),

0 commit comments

Comments
 (0)