diff --git a/src/admin/components/edition/item-edition-form.vue b/src/admin/components/edition/item-edition-form.vue index e3437f3e7..8615ce6ae 100644 --- a/src/admin/components/edition/item-edition-form.vue +++ b/src/admin/components/edition/item-edition-form.vue @@ -468,6 +468,11 @@ export default { this.updateItemDocument({ item_id: this.itemId, document: this.form.document, document_type: this.form.document_type }) .then((item) => { this.item.document_as_html = item.document_as_html; + + let oldThumbnail = this.item.thumbnail; + if (item.document_type == 'attachment' && oldThumbnail != item.thumbnail ) + this.item.thumbnail = item.thumbnail; + }) .catch(error => this.$console.error(error)); } diff --git a/src/js/store/modules/item/actions.js b/src/js/store/modules/item/actions.js index a4c26df7b..5d138c6f1 100644 --- a/src/js/store/modules/item/actions.js +++ b/src/js/store/modules/item/actions.js @@ -118,7 +118,9 @@ export const updateItemDocument = ({ commit }, { item_id, document, document_typ document: document, document_type: document_type }).then( res => { - commit('setItem', res.data); + let item = res.data; + + commit('setItem', item); resolve( res.data ); }).catch( error => { reject({ error_message: error['response']['data'].error_message, errors: error['response']['data'].errors });