Skip to content

Commit

Permalink
Simplify data retrieval
Browse files Browse the repository at this point in the history
  • Loading branch information
swyngaard committed Feb 6, 2020
1 parent f2dcc2d commit e2afe9a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
18 changes: 7 additions & 11 deletions js/egm.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,18 +64,14 @@ const app = new Vue({
filtered_documents: [],
filter_categories: {}
},
mounted: function () {
axios
.get('https://raw.githubusercontent.com/crcresearch/usaid-pse-egm/master/data/latest.json')
.then(response => axios.get(`https://raw.githubusercontent.com/crcresearch/usaid-pse-egm/master/data/${response.data}`))
.then(response => {
this.documents = response.data.records;
this.filtered_documents = this.documents;
this.filtered_summary = this.filter_records();
this.filter_categories = response.data.filteredFields;
});
mounted: async function () {
const response = await axios.get('data/latest.json', { responseType: 'json' });
this.documents = response.data.records;
this.filtered_documents = this.documents;
this.filtered_summary = this.filter_records();
this.filter_categories = response.data.filteredFields;
},
// define methods under the `methods` object

methods: {
filter_records: function () {
const new_summary = [
Expand Down
2 changes: 2 additions & 0 deletions robots.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
User-agent: *
Disallow: /.github/

0 comments on commit e2afe9a

Please sign in to comment.