mirror of
https://github.com/Lissy93/dashy.git
synced 2025-07-31 01:24:42 +02:00
⚡ Refactored request in RSS widget (#632)
This commit is contained in:
parent
2fe0110762
commit
9eda048842
@ -31,7 +31,6 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import axios from 'axios';
|
|
||||||
import WidgetMixin from '@/mixins/WidgetMixin';
|
import WidgetMixin from '@/mixins/WidgetMixin';
|
||||||
import { widgetApiEndpoints } from '@/utils/defaults';
|
import { widgetApiEndpoints } from '@/utils/defaults';
|
||||||
|
|
||||||
@ -91,16 +90,7 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
/* Make GET request to Rss2Json */
|
/* Make GET request to Rss2Json */
|
||||||
fetchData() {
|
fetchData() {
|
||||||
axios.get(this.endpoint)
|
this.makeRequest(this.endpoint).then(this.processData);
|
||||||
.then((response) => {
|
|
||||||
this.processData(response.data);
|
|
||||||
})
|
|
||||||
.catch((error) => {
|
|
||||||
this.error('Unable to RSS feed', error);
|
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
this.finishLoading();
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
/* Assign data variables to the returned data */
|
/* Assign data variables to the returned data */
|
||||||
processData(data) {
|
processData(data) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user