Skip to content

Commit

Permalink
Change API call on created()
Browse files Browse the repository at this point in the history
  • Loading branch information
sylvainjule committed Dec 12, 2018
1 parent 53c2227 commit 9304431
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 21 deletions.
2 changes: 1 addition & 1 deletion index.js

Large diffs are not rendered by default.

9 changes: 1 addition & 8 deletions src/components/main.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,8 @@ export default {
chartEmpty: false,
}
},
props: {
parent: String,
name: String,
},
computed: {
},
created() {
this.$api
.get(this.parent + "/sections/" + this.name)
this.load()
.then(response => {
this.periods = response.periods
this.defaults = Object.assign(this.defaults, response.defaults)
Expand Down
7 changes: 1 addition & 6 deletions src/components/page.vue
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,6 @@ export default {
all: [],
}
},
props: {
parent: String,
name: String,
},
computed: {
isEmpty() {
return (this.status == 'empty' || !Object.keys(this.current).length) && !this.loading
Expand Down Expand Up @@ -88,8 +84,7 @@ export default {
init() {
this.loading = true
this.status = 'loading'
this.$api
.get(this.parent + "/sections/" + this.name)
this.load()
.then(response => {
this.lang = response.lang
this.uri = response.uri
Expand Down
7 changes: 1 addition & 6 deletions src/components/sidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,13 @@ export default {
summary: false,
}
},
props: {
parent: String,
name: String,
},
computed: {
showLink() {
return this.link && this.url
}
},
created() {
this.$api
.get(this.parent + "/sections/" + this.name)
this.load()
.then(response => {
this.url = response.url
this.link = response.link
Expand Down

0 comments on commit 9304431

Please sign in to comment.