scinote-web/app/javascript/vue/shared/content/attachments/mixins/move.js

25 lines
558 B
JavaScript
Raw Normal View History

import axios from '../../../../../packs/custom_axios.js';
export default {
data() {
return {
movingAttachment: false
};
},
methods: {
showMoveModal() {
2023-08-25 15:46:53 +08:00
this.movingAttachment = true;
},
closeMoveModal() {
this.movingAttachment = false;
},
2023-08-25 15:46:53 +08:00
moveAttachment(targetId) {
axios.post(this.attachment.attributes.urls.move, { target_id: targetId })
.then(() => {
this.movingAttachment = false;
2023-08-25 15:46:53 +08:00
this.$emit('attachment:moved', this.attachment.id, targetId);
});
}
}
};