Skip to content

Commit 9304431

Browse files
committed
Change API call on created()
1 parent 53c2227 commit 9304431

File tree

4 files changed

+4
-21
lines changed

4 files changed

+4
-21
lines changed

index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/components/main.vue

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,8 @@ export default {
4040
chartEmpty: false,
4141
}
4242
},
43-
props: {
44-
parent: String,
45-
name: String,
46-
},
47-
computed: {
48-
},
4943
created() {
50-
this.$api
51-
.get(this.parent + "/sections/" + this.name)
44+
this.load()
5245
.then(response => {
5346
this.periods = response.periods
5447
this.defaults = Object.assign(this.defaults, response.defaults)

src/components/page.vue

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,6 @@ export default {
4949
all: [],
5050
}
5151
},
52-
props: {
53-
parent: String,
54-
name: String,
55-
},
5652
computed: {
5753
isEmpty() {
5854
return (this.status == 'empty' || !Object.keys(this.current).length) && !this.loading
@@ -88,8 +84,7 @@ export default {
8884
init() {
8985
this.loading = true
9086
this.status = 'loading'
91-
this.$api
92-
.get(this.parent + "/sections/" + this.name)
87+
this.load()
9388
.then(response => {
9489
this.lang = response.lang
9590
this.uri = response.uri

src/components/sidebar.vue

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,13 @@ export default {
2525
summary: false,
2626
}
2727
},
28-
props: {
29-
parent: String,
30-
name: String,
31-
},
3228
computed: {
3329
showLink() {
3430
return this.link && this.url
3531
}
3632
},
3733
created() {
38-
this.$api
39-
.get(this.parent + "/sections/" + this.name)
34+
this.load()
4035
.then(response => {
4136
this.url = response.url
4237
this.link = response.link

0 commit comments

Comments
 (0)