Fixes single valued taxonomy term insertion from item edition page.

This commit is contained in:
mateuswetah 2021-06-14 14:08:29 -03:00
parent e3de28d7a9
commit e484f1d18e
2 changed files with 2 additions and 2 deletions

View File

@ -176,7 +176,7 @@
if (this.metadatumComponent == 'tainacan-compound')
return;
if (this.itemMetadatum.value !== null) {
if (this.itemMetadatum.value !== null && this.itemMetadatum.value !== false) {
// This routine avoids calling the API if the value did not changed
switch(this.itemMetadatum.value.constructor.name) {

View File

@ -143,7 +143,7 @@
let val = this.valueComponent;
if (!Array.isArray(val) && this.itemMetadatum.metadatum.multiple === 'no') {
if ((!Array.isArray(val) || val.length == 0) && this.itemMetadatum.metadatum.multiple === 'no') {
axios.patch(`/item/${this.itemMetadatum.item.id}/metadata/${this.itemMetadatum.metadatum.id}`, {
values: term.id,
}).then(() => {