diff options
author | Bastien Wirtz <bastien.wirtz@gmail.com> | 2022-04-07 22:33:20 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-07 22:33:20 +0200 |
commit | 7341d7634b5a7d66e7eab921c0fcfe7034d2047f (patch) | |
tree | 943e41fee0bc8e4333d64331fab42b967d7f9d2e /src/mixins/service.js | |
parent | b2a41400540b5003431bd83f6859b74991f195c5 (diff) | |
parent | 9e1e82b0f3ce57f95f21fc09c70e2711e5105997 (diff) | |
download | homer-7341d7634b5a7d66e7eab921c0fcfe7034d2047f.tar.gz homer-7341d7634b5a7d66e7eab921c0fcfe7034d2047f.tar.zst homer-7341d7634b5a7d66e7eab921c0fcfe7034d2047f.zip |
Merge branch 'main' into feature/adguard-home-customservices-doc
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 | } |