Refactors NetData widget data requeest

This commit is contained in:
Alicia Sykes
2022-01-28 23:21:30 +00:00
parent 6e2ae6d3fc
commit eb1bc69155
4 changed files with 4 additions and 18 deletions

View File

@@ -3,7 +3,6 @@
</template>
<script>
import axios from 'axios';
import WidgetMixin from '@/mixins/WidgetMixin';
import ChartingMixin from '@/mixins/ChartingMixin';
@@ -34,16 +33,7 @@ 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(this.processData);
},
/* Assign data variables to the returned data */
processData(data) {