mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-28 23:01:09 +03:00
Bugfix/Add date input type for custom tool (#4087)
add date input type for custom tool
This commit is contained in:
@@ -820,6 +820,12 @@ export const convertSchemaToZod = (schema: string | object): ICommonObject => {
|
||||
} else {
|
||||
zodObj[sch.property] = z.boolean().describe(sch.description).optional()
|
||||
}
|
||||
} else if (sch.type === 'date') {
|
||||
if (sch.required) {
|
||||
zodObj[sch.property] = z.date({ required_error: `${sch.property} required` }).describe(sch.description)
|
||||
} else {
|
||||
zodObj[sch.property] = z.date().describe(sch.description).optional()
|
||||
}
|
||||
}
|
||||
}
|
||||
return zodObj
|
||||
|
||||
Reference in New Issue
Block a user