diff --git a/resources/assets/js/home/modal/ModalComments.vue b/resources/assets/js/home/modal/ModalComments.vue index 5ee283941..e6d6de3a7 100644 --- a/resources/assets/js/home/modal/ModalComments.vue +++ b/resources/assets/js/home/modal/ModalComments.vue @@ -93,20 +93,18 @@ export default { }) ) .then((response) => { - if ( - response.data.success === "success" && - response.data.message == "" - ) { + if (response.status === 200) { that.attachDocuments = false; that.dataAttachedDocuments.items = []; that.getCasesNotes(); this.$refs["modal-comments"].hide(); - this.$emit("postNotes"); - } else { - that.showAlert(response.data.message, "danger"); - that.dataAttachedDocuments.items = []; + this.$emit("postNotes"); } - }); + }) + .catch((error) => { + that.showAlert(error.response.data.error.message, "danger"); + that.dataAttachedDocuments.items = []; + }) }, }; },