Added button to send observations data by email

This commit is contained in:
neviyn 2019-07-25 14:59:59 +01:00
parent b8a9321b3d
commit 5154820325

View File

@ -180,7 +180,12 @@
</b-tab>
</b-tabs>
</b-card>
<b-button class="mt-2" variant="success" @click="getCSV()">CSV Dump</b-button>
<b-button class="mt-2" variant="success" @click="getCSV()"
>CSV Dump</b-button
>
<b-button class="mt-2" variant="success" @click="sendEmail()"
>Send as Email</b-button
>
</b-container>
<b-container v-else-if="loading">Loading...</b-container>
<b-container v-else>
@ -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();
});
}
}
};