refactor(ui): cleanup CSS styles namespace
[e-mobility-charging-stations-simulator.git] / ui / web / src / components / actions / AddChargingStations.vue
index b1409bb714087e40c98900c20f2a415b42dedb0e..94879da1c0d089512b144c57e4b01f1d3f7e49e2 100644 (file)
@@ -9,11 +9,17 @@ const app = getCurrentInstance()
 const uiClient = app?.appContext.config.globalProperties.$uiClient
 
 onMounted(() => {
-  uiClient.listTemplates().then((response: ResponsePayload) => {
-    if (app != null && app.appContext.config.globalProperties.$templates == null) {
-      app.appContext.config.globalProperties.$templates = response.templates
-    }
-  })
+  uiClient
+    .listTemplates()
+    .then((response: ResponsePayload) => {
+      if (app != null && app.appContext.config.globalProperties.$templates == null) {
+        app.appContext.config.globalProperties.$templates = response.templates
+      }
+    })
+    .catch((error: Error) => {
+      // TODO: add code for UI notifications or other error handling logic
+      console.error('Error at fetching charging station templates:', error)
+    })
 })
 </script>