refactor: cleanup default params in error handlers
[e-mobility-charging-stations-simulator.git] / ui / web / src / components / charging-stations / CSConnector.vue
index d3e37d637e096ce456acc610c16da2b90762171f..9bfeae6de04620968bfd037e21ba4b1d5c9b8d9a 100644 (file)
@@ -10,7 +10,7 @@
     </td>
     <td class="connectors-table__column">
       <ToggleButton
-        :id="`${hashId}-start-transaction`"
+        :id="`${hashId}-${connectorId}-start-transaction`"
         :shared="true"
         :on="
           () => {
             $router.push({ name: 'charging-stations' })
           }
         "
+        @clicked="
+          () => {
+            $emit('need-refresh')
+          }
+        "
       >
         Start Transaction
       </ToggleButton>
 </template>
 
 <script setup lang="ts">
-import { getCurrentInstance } from 'vue'
 import { useToast } from 'vue-toast-notification'
+
 import Button from '@/components/buttons/Button.vue'
-import type { ConnectorStatus, Status } from '@/types'
 import ToggleButton from '@/components/buttons/ToggleButton.vue'
+import { useUIClient } from '@/composables'
+import type { ConnectorStatus, Status } from '@/types'
 
 const props = defineProps<{
   hashId: string
@@ -50,7 +56,9 @@ const props = defineProps<{
   atgStatus?: Status
 }>()
 
-const uiClient = getCurrentInstance()?.appContext.config.globalProperties.$uiClient
+const $emit = defineEmits(['need-refresh'])
+
+const uiClient = useUIClient()
 
 const $toast = useToast()