Fixes undefined term value on inital term of item submssion form.
This commit is contained in:
parent
b50c407421
commit
2d618712f3
|
@ -145,7 +145,7 @@
|
|||
getTermsId() {
|
||||
let values = [];
|
||||
if (this.value && this.itemMetadatum.metadatum && this.getComponent != 'tainacan-taxonomy-tag-input') {
|
||||
values = this.value.map(term => term.id)
|
||||
values = this.value.map(term => term.id).filter(term => term !== undefined);
|
||||
this.valueComponent = (values.length >= 0 && this.itemMetadatum.metadatum && this.itemMetadatum.metadatum.multiple === 'no') ? values[0] : values;
|
||||
} else if (this.value && this.itemMetadatum.metadatum && this.getComponent == 'tainacan-taxonomy-tag-input') {
|
||||
values = this.value.map((term) => { return { label: term.name, value: term.id } });
|
||||
|
|
Loading…
Reference in New Issue