Lint & updates

This commit is contained in:
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": {
"@fortawesome/fontawesome-free": "^5.15.3",
"bulma": "^0.9.2",
"core-js": "^3.10.1",
"js-yaml": "^4.0.0",
"bulma": "^0.9.3",
"core-js": "^3.15.2",
"js-yaml": "^4.1.0",
"lodash.merge": "^4.6.2",
"register-service-worker": "^1.7.2",
"vue": "^2.6.12"
"vue": "^2.6.14"
},
"devDependencies": {
"@vue/cli-plugin-babel": "~4.5.0",

View File

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

View File

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

4034
yarn.lock

File diff suppressed because it is too large Load Diff