diff options
Diffstat (limited to 'src/mixins/service.js')
-rw-r--r-- | src/mixins/service.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/mixins/service.js b/src/mixins/service.js index ae23a27..17fa6fc 100644 --- a/src/mixins/service.js +++ b/src/mixins/service.js | |||
@@ -12,7 +12,7 @@ export default { | |||
12 | } | 12 | } |
13 | }, | 13 | }, |
14 | methods: { | 14 | methods: { |
15 | fetch: function (path, init) { | 15 | fetch: function (path, init, json = true) { |
16 | let options = {}; | 16 | let options = {}; |
17 | 17 | ||
18 | if (this.proxy?.useCredentials) { | 18 | if (this.proxy?.useCredentials) { |
@@ -35,7 +35,8 @@ export default { | |||
35 | if (!response.ok) { | 35 | if (!response.ok) { |
36 | throw new Error("Not 2xx response"); | 36 | throw new Error("Not 2xx response"); |
37 | } | 37 | } |
38 | return response.json(); | 38 | |
39 | return json ? response.json() : response; | ||
39 | }); | 40 | }); |
40 | }, | 41 | }, |
41 | }, | 42 | }, |