Refactored NetData and HealthChecks with mixin request

This commit is contained in:
Alicia Sykes
2021-12-31 23:56:53 +00:00
parent e3f2b910ec
commit 1914d25b45
4 changed files with 15 additions and 56 deletions

View File

@@ -3,7 +3,6 @@
</template>
<script>
import axios from 'axios';
import WidgetMixin from '@/mixins/WidgetMixin';
import ChartingMixin from '@/mixins/ChartingMixin';
@@ -41,16 +40,9 @@ export default {
methods: {
/* Make GET request to NetData */
fetchData() {
axios.get(this.endpoint)
.then((response) => {
this.processData(response.data);
})
.catch((dataFetchError) => {
this.error('Unable to fetch data', dataFetchError);
})
.finally(() => {
this.finishLoading();
});
this.makeRequest(this.endpoint).then(
(response) => { this.processData(response); },
);
},
/* Assign data variables to the returned data */
processData(data) {