]> git.immae.eu Git - github/bastienwirtz/homer.git/blobdiff - src/mixins/service.js
Merge pull request #385 from saschabrockel/patch-1
[github/bastienwirtz/homer.git] / src / mixins / service.js
index ae23a2742bc5130fc4f08b9a16ab92192afa3f85..17fa6fcc95600f955a55014d878285f1a7c45a4f 100644 (file)
@@ -12,7 +12,7 @@ export default {
     }
   },
   methods: {
-    fetch: function (path, init) {
+    fetch: function (path, init, json = true) {
       let options = {};
 
       if (this.proxy?.useCredentials) {
@@ -35,7 +35,8 @@ export default {
         if (!response.ok) {
           throw new Error("Not 2xx response");
         }
-        return response.json();
+
+        return json ? response.json() : response;
       });
     },
   },