resolving no value issue.

pull/150/head
iozeey 2 years ago
parent 0f1dc7b5e1
commit e57a8d2d06

@ -614,7 +614,7 @@ export default {
this.save() this.save()
}, },
removeField () { removeField () {
const templateValue = this.template.values[this.field.uuid] const templateValue = this.template?.values?.[this.field.uuid]
switch (this.field.type) { switch (this.field.type) {
case 'my_signature': case 'my_signature':
this.showMySignature = false this.showMySignature = false

@ -594,9 +594,9 @@ export default {
} }
}, },
removeArea (area) { removeArea (area) {
const field = this.template.fields.find((f) => f.areas?.includes(area)) const field = this.template.fields?.find((f) => f.areas?.includes(area))
if (['my_text', 'my_signature', 'my_initials', 'my_date'].includes(field.type)) { if (['my_text', 'my_signature', 'my_initials', 'my_date'].includes(field.type) && this.template?.values) {
const valuesArray = Object.values(this.template.values) const valuesArray = Object.values(this.template?.values)
const valueIndex = valuesArray.findIndex((value) => value === this.template.values[field.uuid]) const valueIndex = valuesArray.findIndex((value) => value === this.template.values[field.uuid])
valuesArray.splice(valueIndex, 1) valuesArray.splice(valueIndex, 1)
const valueKey = Object.keys(this.template.values)[valueIndex] const valueKey = Object.keys(this.template.values)[valueIndex]

Loading…
Cancel
Save