Skip to content

Commit b3cc100

Browse files
committed
chore: update check for parsing error
1 parent a7d2bf4 commit b3cc100

File tree

2 files changed

+2
-12
lines changed

2 files changed

+2
-12
lines changed

packages/backend/src/apps/toolbox/actions/for-each/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const action: IRawAction = {
2929
const { items: rawItems } = $.step.parameters
3030
const parsedResult = inputSchema.safeParse(rawItems)
3131

32-
if (!parsedResult.success) {
32+
if (parsedResult.success === false) {
3333
throw new StepError(
3434
'Invalid input list',
3535
'Select a valid input list',

packages/backend/src/apps/toolbox/actions/for-each/schema.ts

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -60,18 +60,8 @@ export const inputSchema = z
6060
}
6161

6262
// Handle checkbox input (comma-separated values)
63-
const items = trimmed.split(',')
64-
65-
if (items.length === 0) {
66-
ctx.addIssue({
67-
code: z.ZodIssueCode.custom,
68-
message: 'No valid items found in comma-separated input',
69-
})
70-
return z.NEVER
71-
}
72-
7363
return {
7464
type: 'checkbox' as const,
75-
items,
65+
items: trimmed.split(','),
7666
}
7767
})

0 commit comments

Comments
 (0)