Refresh thumbnail when selecting an attachment file and back automatically generates one.
This commit is contained in:
parent
2d2fc7b2a1
commit
84655bcf70
|
@ -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));
|
||||
}
|
||||
|
|
|
@ -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 });
|
||||
|
|
Loading…
Reference in New Issue