Refresh thumbnail when selecting an attachment file and back automatically generates one.

This commit is contained in:
Mateus Machado Luna 2018-05-04 12:50:05 -03:00
parent 2d2fc7b2a1
commit 84655bcf70
2 changed files with 8 additions and 1 deletions

View File

@ -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));
}

View File

@ -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 });