]> git.immae.eu Git - github/bastienwirtz/homer.git/blobdiff - src/components/services/PaperlessNG.vue
Merge pull request #181 from dickwolff/main
[github/bastienwirtz/homer.git] / src / components / services / PaperlessNG.vue
index c4f50eb15cf7284083a4f6aad3bd5826bbd4d073..af13317859e1f7e1117cf29bcf9ec02adf9b9ce6 100644 (file)
@@ -52,20 +52,23 @@ export default {
       if (this.item.subtitle != null) return; // omitting unnecessary ajax call as the subtitle is showing
       var apikey = this.item.apikey;
       if (!apikey) {
-        console.error("apikey is not present in config.yml for the paperless entry!");
+        console.error(
+          "apikey is not present in config.yml for the paperless entry!"
+        );
         return;
       }
       const url = `${this.item.url}/api/documents/`;
       this.api = await fetch(url, {
-          headers: {
-            "Authorization": "Token " + this.item.apikey
-          }
-        })
-        .then(function(response) {
+        credentials: "include",
+        headers: {
+          Authorization: "Token " + this.item.apikey,
+        },
+      })
+        .then(function (response) {
           if (!response.ok) {
-            throw new Error("Not 2xx response")
+            throw new Error("Not 2xx response");
           } else {
-            return response.json()
+            return response.json();
           }
         })
         .catch((e) => console.log(e));