scinote-web/app/javascript/vue/shared/content/attachments/mixins/move.js
2023-08-25 09:46:53 +02:00

25 lines
594 B
JavaScript

import axios from '../../../../../packs/custom_axios.js';
export default {
data() {
return {
movingAttachment: false
};
},
methods: {
showMoveModal(event) {
event.stopPropagation();
this.movingAttachment = true;
},
closeMoveModal() {
this.movingAttachment = false;
},
moveAttachment(targetId) {
axios.post(this.attachment.attributes.urls.move, { target_id: targetId })
.then(() => {
this.movingAttachment = false;
this.$emit('attachment:moved', this.attachment.id, targetId);
});
}
}
};