From 5154820325b04f61e8d8b1fd5118109196f58846 Mon Sep 17 00:00:00 2001 From: Nathan Cannon Date: Thu, 25 Jul 2019 14:59:59 +0100 Subject: [PATCH] Added button to send observations data by email --- frontend/src/views/ViewObservations.vue | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/frontend/src/views/ViewObservations.vue b/frontend/src/views/ViewObservations.vue index aa2f154..8c76528 100644 --- a/frontend/src/views/ViewObservations.vue +++ b/frontend/src/views/ViewObservations.vue @@ -180,7 +180,12 @@ - CSV Dump + CSV Dump + Send as Email Loading... @@ -289,6 +294,13 @@ export default { setInterval: function(amount, timeType) { this.endDate = moment(); this.startDate = moment().subtract(amount, timeType); + }, + sendEmail: function() { + Vue.axios.post("/observations/email").catch(error => { + this.errorStatus = error.response.status; + this.errorMessage = error.response.data; + this.$refs.errorModal.show(); + }); } } };