From 3d9a23f9aaeccb0f5f64a57c4a288140da0f1d2f Mon Sep 17 00:00:00 2001 From: Fine Date: Tue, 29 Aug 2023 16:08:14 +0800 Subject: [PATCH] fix: dest endpoint selector --- src/layout/components/NavBar.vue | 2 +- src/store/modules/selectors.ts | 22 +++++++++++----------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/layout/components/NavBar.vue b/src/layout/components/NavBar.vue index efe99cba..3b1fe5ba 100644 --- a/src/layout/components/NavBar.vue +++ b/src/layout/components/NavBar.vue @@ -83,8 +83,8 @@ limitations under the License. --> } function getPathNames() { - const dashboard = dashboardStore.currentDashboard; pathNames.value = []; + const dashboard = dashboardStore.currentDashboard; const root = dashboardStore.dashboards.filter((d: DashboardItem) => d.isRoot && dashboard.layer === d.layer)[0] || {}; for (const item of appStore.allMenus) { diff --git a/src/store/modules/selectors.ts b/src/store/modules/selectors.ts index 74d62399..4101b850 100644 --- a/src/store/modules/selectors.ts +++ b/src/store/modules/selectors.ts @@ -184,7 +184,7 @@ export const selectorStore = defineStore({ if (isRelation) { this.currentDestPod = res.data.data.instance || null; this.destPods = [res.data.data.instance]; - return; + return res.data; } this.currentPod = res.data.data.instance || null; this.pods = [res.data.data.instance]; @@ -199,16 +199,16 @@ export const selectorStore = defineStore({ const res: AxiosResponse = await graphql.query("queryEndpoint").params({ endpointId, }); - if (!res.data.errors) { - if (isRelation) { - this.currentDestPod = res.data.data.endpoint || null; - this.destPods = [res.data.data.endpoint]; - return; - } - this.currentPod = res.data.data.endpoint || null; - this.pods = [res.data.data.endpoint]; + if (res.data.errors) { + return res.data; } - + if (isRelation) { + this.currentDestPod = res.data.data.endpoint || null; + this.destPods = [res.data.data.endpoint]; + return res.data; + } + this.currentPod = res.data.data.endpoint || null; + this.pods = [res.data.data.endpoint]; return res.data; }, async getProcess(processId: string, isRelation?: boolean) { @@ -222,7 +222,7 @@ export const selectorStore = defineStore({ if (isRelation) { this.currentDestProcess = res.data.data.process || null; this.destProcesses = [res.data.data.process]; - return; + return res.data; } this.currentProcess = res.data.data.process || null; this.processes = [res.data.data.process];