diff options
Diffstat (limited to 'src/mixins/service.js')
-rw-r--r-- | src/mixins/service.js | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/mixins/service.js b/src/mixins/service.js index 17fa6fc..abc708c 100644 --- a/src/mixins/service.js +++ b/src/mixins/service.js | |||
@@ -31,7 +31,13 @@ export default { | |||
31 | path = path.slice(1); | 31 | path = path.slice(1); |
32 | } | 32 | } |
33 | 33 | ||
34 | return fetch(`${this.endpoint}/${path}`, options).then((response) => { | 34 | let url = this.endpoint; |
35 | |||
36 | if (path) { | ||
37 | url = `${this.endpoint}/${path}`; | ||
38 | } | ||
39 | |||
40 | return fetch(url, options).then((response) => { | ||
35 | if (!response.ok) { | 41 | if (!response.ok) { |
36 | throw new Error("Not 2xx response"); | 42 | throw new Error("Not 2xx response"); |
37 | } | 43 | } |