Fallback defaultFieldOptionsState options to array

This commit is contained in:
Jože Fortun
2023-04-04 14:04:58 +02:00
parent dd614ee4b3
commit 6ef07e0e42
@@ -142,13 +142,10 @@ export default {
},
defaultFieldOptionsState () {
const field = this.moduleDefaultState.fields.find(({ name }) => name === this.f.name)
const field = this.moduleDefaultState.fields.find(({ name }) => name === this.f.name) || {}
const { options = [] } = field.options
if (field) {
return field.options.options.map(({ value }) => value)
}
return []
return options.map(({ value }) => value)
},
},