From c3a0c1a40262343e1c7e6ec9a0bba9772054ba6d Mon Sep 17 00:00:00 2001
From: Mateja <mail@matejamaric.com>
Date: Sun, 14 Mar 2021 01:13:32 +0100
Subject: Use computed setter in call-sign-filter component.

---
 resources/js/components/call-sign-filter.vue | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

(limited to 'resources/js/components/call-sign-filter.vue')

diff --git a/resources/js/components/call-sign-filter.vue b/resources/js/components/call-sign-filter.vue
index 9ad202d..658b0d2 100644
--- a/resources/js/components/call-sign-filter.vue
+++ b/resources/js/components/call-sign-filter.vue
@@ -9,18 +9,20 @@
 import store from '../store.js';
 
 export default {
-  data() {
-    return {
-      selected: store.state.selectedSign,
-      //options: store.state.callSigns
-    }
-  },
   mounted() {
-    store.dispatch('getSigns');
+    store.dispatch('fillSigns');
   },
   computed: {
+    selected: {
+      get() {
+        return store.getters.getSelectedSign;
+      },
+      set(value) {
+        store.dispatch('setSelectedSign', value);
+      }
+    },
     options() {
-      return store.state.callSigns;
+      return store.getters.getSigns;
     }
   }
 }
-- 
cgit v1.2.3

