fix: autoformfieldovject not utilisng base schema

This commit is contained in:
Michael De Giovanni 2024-05-03 17:03:04 +02:00
parent 9dfb0b86c0
commit a655e1473c
2 changed files with 4 additions and 2 deletions

View File

@ -28,7 +28,8 @@ const shapes = computed(() => {
return
Object.keys(shape).forEach((name) => {
const item = shape[name] as ZodAny
let options = 'values' in item._def ? item._def.values as string[] : undefined
const baseItem = getBaseSchema(item) as ZodAny
let options = (baseItem && 'values' in baseItem._def) ? baseItem._def.values as string[] : undefined
if (!Array.isArray(options) && typeof options === 'object')
options = Object.values(options)

View File

@ -28,7 +28,8 @@ const shapes = computed(() => {
return
Object.keys(shape).forEach((name) => {
const item = shape[name] as ZodAny
let options = 'values' in item._def ? item._def.values as string[] : undefined
const baseItem = getBaseSchema(item) as ZodAny
let options = (baseItem && 'values' in baseItem._def) ? baseItem._def.values as string[] : undefined
if (!Array.isArray(options) && typeof options === 'object')
options = Object.values(options)