From f7cf98655c05a27037676279cab27f31f020dee8 Mon Sep 17 00:00:00 2001 From: "Ethan.Z" Date: Thu, 14 Nov 2024 13:34:55 -0500 Subject: [PATCH] restructure getEndpointIds to pass ui.test.js - call API directly without action - check if $serverGet defined before calling it --- src/components/ZclCreateModifyEndpoint.vue | 8 +++++--- src/store/zap/actions.js | 8 -------- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/src/components/ZclCreateModifyEndpoint.vue b/src/components/ZclCreateModifyEndpoint.vue index 04159d1c4a..2553c077fb 100644 --- a/src/components/ZclCreateModifyEndpoint.vue +++ b/src/components/ZclCreateModifyEndpoint.vue @@ -544,9 +544,11 @@ export default { } }, getEndpointIds() { - this.$store.dispatch('zap/getEndpointIds').then((res) => { - this.endpointIds = res.data - }) + if (this.$serverGet != null) { + this.$serverGet(RestApi.uri.endpointIds).then((resp) => { + this.endpointIds = resp.data + }) + } }, // This function will close the endpoint modal toggleCreateEndpointModal() { diff --git a/src/store/zap/actions.js b/src/store/zap/actions.js index c7c714663f..be65481928 100644 --- a/src/store/zap/actions.js +++ b/src/store/zap/actions.js @@ -513,14 +513,6 @@ export function addEndpoint(context, newEndpointContext) { }) } -/** - * Get endpoint ids. - * @returns endpoints ids - */ -export async function getEndpointIds() { - return await axiosRequests.$serverGet(restApi.uri.endpointIds) -} - /** * Add endpoint type for ZAP UI. * @param {*} context