mirror of
https://github.com/baptisteArno/typebot.io.git
synced 2026-06-25 21:01:54 +08:00
✨ Add support for array type in Generate variables actions
Closes #1870
This commit is contained in:
parent
96ec9ef44d
commit
de7f96ac0c
@ -37,6 +37,11 @@ export const variablesToExtractSchema = option
|
||||
type: option.literal("boolean"),
|
||||
})
|
||||
.extend(extractInfoBaseShape),
|
||||
option
|
||||
.object({
|
||||
type: option.literal("array"),
|
||||
})
|
||||
.extend(extractInfoBaseShape),
|
||||
option
|
||||
.object({
|
||||
type: option.literal("enum"),
|
||||
|
||||
@ -85,6 +85,9 @@ const convertVariablesToExtractToSchema = ({
|
||||
case "boolean":
|
||||
shape[matchingVariable.name] = z.boolean();
|
||||
break;
|
||||
case "array":
|
||||
shape[matchingVariable.name] = z.array(z.string());
|
||||
break;
|
||||
case "enum": {
|
||||
if (!variableToExtract.values || variableToExtract.values.length === 0)
|
||||
return;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user