Lint & updates

pull/235/head^2
Bastien Wirtz 2021-07-14 12:05:53 +02:00
parent f9cc1d27cc
commit c06c0cdf9b
5 changed files with 2038 additions and 2032 deletions

View File

@ -9,12 +9,12 @@
}, },
"dependencies": { "dependencies": {
"@fortawesome/fontawesome-free": "^5.15.3", "@fortawesome/fontawesome-free": "^5.15.3",
"bulma": "^0.9.2", "bulma": "^0.9.3",
"core-js": "^3.10.1", "core-js": "^3.15.2",
"js-yaml": "^4.0.0", "js-yaml": "^4.1.0",
"lodash.merge": "^4.6.2", "lodash.merge": "^4.6.2",
"register-service-worker": "^1.7.2", "register-service-worker": "^1.7.2",
"vue": "^2.6.12" "vue": "^2.6.14"
}, },
"devDependencies": { "devDependencies": {
"@vue/cli-plugin-babel": "~4.5.0", "@vue/cli-plugin-babel": "~4.5.0",

View File

@ -51,9 +51,9 @@ export default {
}, },
methods: { methods: {
fetchStatus: async function () { fetchStatus: async function () {
this.status = await fetch( this.status = await fetch(`${this.item.url}/control/status`).then(
`${this.item.url}/control/status` (response) => response.json()
).then((response) => response.json()); );
}, },
}, },
}; };

View File

@ -52,20 +52,22 @@ export default {
if (this.item.subtitle != null) return; // omitting unnecessary ajax call as the subtitle is showing if (this.item.subtitle != null) return; // omitting unnecessary ajax call as the subtitle is showing
var apikey = this.item.apikey; var apikey = this.item.apikey;
if (!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; return;
} }
const url = `${this.item.url}/api/documents/`; const url = `${this.item.url}/api/documents/`;
this.api = await fetch(url, { this.api = await fetch(url, {
headers: { headers: {
"Authorization": "Token " + this.item.apikey Authorization: "Token " + this.item.apikey,
} },
}) })
.then(function(response) { .then(function (response) {
if (!response.ok) { if (!response.ok) {
throw new Error("Not 2xx response") throw new Error("Not 2xx response");
} else { } else {
return response.json() return response.json();
} }
}) })
.catch((e) => console.log(e)); .catch((e) => console.log(e));

View File

@ -53,8 +53,8 @@ export default {
fetchStatus: async function () { fetchStatus: async function () {
const url = `${this.item.url}`; const url = `${this.item.url}`;
this.api.status = await fetch(url) this.api.status = await fetch(url)
.then((response) => "enabled") .then(() => "enabled")
.catch((e) => "disabled"); .catch(() => "disabled");
}, },
}, },
}; };

4034
yarn.lock

File diff suppressed because it is too large Load Diff