Fixes bug where multivalored relationship metada was initially filled with several values.

This commit is contained in:
Mateus Machado Luna 2018-08-21 10:21:48 -03:00
parent 4effd863a8
commit 43fb79a6f9
2 changed files with 3 additions and 4 deletions

View File

@ -96,7 +96,7 @@ export default {
&:hover {
cursor: pointer;
.image, .file-placeholder {
transform: scale(1.1);
transform: scale(1.05);
}
}
.image-wrapper {

View File

@ -22,10 +22,9 @@
export default {
created(){
let collectionId = ( this.metadatum && this.metadatum.metadatum.metadata_type_options.collection_id ) ? this.metadatum.metadatum.metadata_type_options.collection_id : this.collection_id;
if( this.metadatum.value ){
if( this.metadatum.value && (Array.isArray( this.metadatum.value ) ? this.metadatum.value.length > 0 : true )){
let query = qs.stringify({ postin: ( Array.isArray( this.metadatum.value ) ) ? this.metadatum.value : [ this.metadatum.value ] });
axios.get('/collection/'+collectionId+'/items?' + query + '?nopaging=1')
axios.get('/collection/'+collectionId+'/items?' + query + '&nopaging=1')
.then( res => {
for (let item of res.data) {
this.selected.push({ label: item.title, value: item.id, img: '' });