From 018344d9116b506c662ecdcee2d0d505c857f1cf Mon Sep 17 00:00:00 2001
From: royto <royto81+github@gmail.com>
Date: Sun, 6 Aug 2023 22:46:36 +0200
Subject: PR review: use API const and lint

---
 src/components/services/Readarr.vue | 17 ++++++-----------
 1 file changed, 6 insertions(+), 11 deletions(-)

(limited to 'src/components/services/Readarr.vue')

diff --git a/src/components/services/Readarr.vue b/src/components/services/Readarr.vue
index d921c29..6ac6be2 100644
--- a/src/components/services/Readarr.vue
+++ b/src/components/services/Readarr.vue
@@ -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;
         })
-- 
cgit v1.2.3

