diff --git a/frontend/src/views/ViewObservations.vue b/frontend/src/views/ViewObservations.vue index 840309e..6271181 100644 --- a/frontend/src/views/ViewObservations.vue +++ b/frontend/src/views/ViewObservations.vue @@ -49,6 +49,20 @@ + +
+ +
+
@@ -290,7 +304,7 @@ CSV Dump  - Send as Email @@ -323,7 +337,8 @@ export default { observationData: null, errorStatus: null, errorMessage: null, - loading: false + loading: false, + submitPassword: null }; }, computed: { @@ -403,7 +418,18 @@ export default { this.endDate = moment(); this.startDate = moment().subtract(amount, timeType); }, + getPasswordToSendEmail: function() { + this.submitPassword = null; + this.$refs.submissionModal.show(); + }, sendEmail: function() { + this.$refs.submissionModal.hide(); + let axiosConfig = { + auth: { + username: "admin", + password: this.submitPassword + } + }; this.$refs.emailSendingModal.show(); Vue.axios .post("/observations/email", { @@ -413,7 +439,7 @@ export default { endDate: moment(this.endDate).format("YYYY-MM-DD"), whom: this.$store.state.search.whom, person: this.$store.state.search.person - }) + }, axiosConfig) .then(() => { this.$refs.emailSendingModal.hide(); this.$refs.emailCompleteModal.show(); @@ -424,6 +450,7 @@ export default { this.errorMessage = error.response.data; this.$refs.errorModal.show(); }); + this.submitPassword = null; } } };