aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/components/services/PaperlessNG.vue
diff options
context:
space:
mode:
authorAndreas Waschinski <25221082+waschinski@users.noreply.github.com>2021-07-28 16:13:50 +0200
committerAndreas Waschinski <25221082+waschinski@users.noreply.github.com>2021-07-28 16:13:50 +0200
commitb2062fb60ad2845bcba8a517220ca3637e1a885b (patch)
treed0dce6450034f697618c117383a67af0ac03075d /src/components/services/PaperlessNG.vue
parent4386cd094b4e7869a7fa5aad3a9df9cd1d282021 (diff)
parent35926e1e6e4669e881b8f69003f97752172eb922 (diff)
downloadhomer-b2062fb60ad2845bcba8a517220ca3637e1a885b.tar.gz
homer-b2062fb60ad2845bcba8a517220ca3637e1a885b.tar.zst
homer-b2062fb60ad2845bcba8a517220ca3637e1a885b.zip
Merge remote-tracking branch 'upstream/main' into mealie-service
Diffstat (limited to 'src/components/services/PaperlessNG.vue')
-rw-r--r--src/components/services/PaperlessNG.vue18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/components/services/PaperlessNG.vue b/src/components/services/PaperlessNG.vue
index c4f50eb..4fb31f8 100644
--- a/src/components/services/PaperlessNG.vue
+++ b/src/components/services/PaperlessNG.vue
@@ -52,20 +52,22 @@ export default {
52 if (this.item.subtitle != null) return; // omitting unnecessary ajax call as the subtitle is showing 52 if (this.item.subtitle != null) return; // omitting unnecessary ajax call as the subtitle is showing
53 var apikey = this.item.apikey; 53 var apikey = this.item.apikey;
54 if (!apikey) { 54 if (!apikey) {
55 console.error("apikey is not present in config.yml for the paperless entry!"); 55 console.error(
56 "apikey is not present in config.yml for the paperless entry!"
57 );
56 return; 58 return;
57 } 59 }
58 const url = `${this.item.url}/api/documents/`; 60 const url = `${this.item.url}/api/documents/`;
59 this.api = await fetch(url, { 61 this.api = await fetch(url, {
60 headers: { 62 headers: {
61 "Authorization": "Token " + this.item.apikey 63 Authorization: "Token " + this.item.apikey,
62 } 64 },
63 }) 65 })
64 .then(function(response) { 66 .then(function (response) {
65 if (!response.ok) { 67 if (!response.ok) {
66 throw new Error("Not 2xx response") 68 throw new Error("Not 2xx response");
67 } else { 69 } else {
68 return response.json() 70 return response.json();
69 } 71 }
70 }) 72 })
71 .catch((e) => console.log(e)); 73 .catch((e) => console.log(e));