Fixes single valued taxonomy term insertion from item edition page.
This commit is contained in:
parent
e3de28d7a9
commit
e484f1d18e
|
@ -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) {
|
||||
|
|
|
@ -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(() => {
|
||||
|
|
Loading…
Reference in New Issue