]> git.immae.eu Git - github/bastienwirtz/homer.git/commitdiff
PR review: use API const and lint
authorroyto <royto81+github@gmail.com>
Sun, 6 Aug 2023 20:46:36 +0000 (22:46 +0200)
committerBastien Wirtz <bastien.wirtz@gmail.com>
Tue, 8 Aug 2023 19:48:44 +0000 (12:48 -0700)
src/components/services/Readarr.vue

index d921c29cafc08ffe6b2693c938bf4c48a1bb6546..6ac6be2d5257b08bcd573bdd32ee2f5ece6c9a24 100644 (file)
@@ -52,29 +52,24 @@ export default {
   created: function () {
     this.fetchConfig();
   },
-  computed: {
-    apiPath() {
-      return API;
-    },
-  },
   methods: {
     fetchConfig: function () {
       const handleError = (e) => {
         console.error(e);
         this.serverError = true;
-      }
-      this.fetch(`${this.apiPath}/health?apikey=${this.item.apikey}`)
+      };
+      this.fetch(`${API}/health?apikey=${this.item.apikey}`)
         .then((health) => {
-          this.warnings = health.filter(h => h.type === 'warning').length;
-          this.errors = health.filter(h => h.type === 'errors').length;
+          this.warnings = health.filter((h) => h.type === "warning").length;
+          this.errors = health.filter((h) => h.type === "errors").length;
         })
         .catch(handleError);
-      this.fetch(`${this.apiPath}/queue?apikey=${this.item.apikey}`)
+      this.fetch(`${API}/queue?apikey=${this.item.apikey}`)
         .then((queue) => {
           this.activity = queue.totalRecords;
         })
         .catch(handleError);
-        this.fetch(`${this.apiPath}/wanted/missing?apikey=${this.item.apikey}`)
+      this.fetch(`${API}/wanted/missing?apikey=${this.item.apikey}`)
         .then((missing) => {
           this.missing = missing.totalRecords;
         })