X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=ui%2Fweb%2Fsrc%2Fcomponents%2Factions%2FAddChargingStations.vue;h=94879da1c0d089512b144c57e4b01f1d3f7e49e2;hb=b9d447d2a538b560faa62320f7b37ce1a66c9a80;hp=b1409bb714087e40c98900c20f2a415b42dedb0e;hpb=7086aac2294163414002bc34bab83acf515a5d37;p=e-mobility-charging-stations-simulator.git diff --git a/ui/web/src/components/actions/AddChargingStations.vue b/ui/web/src/components/actions/AddChargingStations.vue index b1409bb7..94879da1 100644 --- a/ui/web/src/components/actions/AddChargingStations.vue +++ b/ui/web/src/components/actions/AddChargingStations.vue @@ -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) + }) })