Skip to content

Commit 7e92df4

Browse files
committed
Load endpoints from parent too
1 parent b765ccf commit 7e92df4

File tree

2 files changed

+11
-15
lines changed

2 files changed

+11
-15
lines changed

src/Frontend/src/components/audit/AuditList.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ onBeforeMount(async () => {
108108
109109
watchHandle.resume();
110110
111-
await store.refresh();
111+
await Promise.all([store.refresh(), store.loadEndpoints()]);
112112
113113
firstLoad = false;
114114
});

src/Frontend/src/stores/AuditStore.ts

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { useTypedFetchFromServiceControl } from "@/composables/serviceServiceControlUrls";
22
import { acceptHMRUpdate, defineStore } from "pinia";
33
import { ref } from "vue";
4-
import useAutoRefresh from "@/composables/autoRefresh";
54
import type { SortInfo } from "@/components/SortInfo";
65
import Message from "@/resources/Message";
76
import { EndpointsView } from "@/resources/EndpointView.ts";
@@ -20,19 +19,15 @@ export const useAuditStore = defineStore("AuditStore", () => {
2019
const selectedEndpointName = ref<string>("");
2120
const endpoints = ref<EndpointsView[]>([]);
2221

23-
useAutoRefresh(
24-
async () => {
25-
try {
26-
const [, data] = await useTypedFetchFromServiceControl<EndpointsView[]>(`endpoints`);
27-
endpoints.value = data;
28-
} catch (e) {
29-
endpoints.value = [];
30-
throw e;
31-
}
32-
},
33-
30000,
34-
true
35-
);
22+
async function loadEndpoints() {
23+
try {
24+
const [, data] = await useTypedFetchFromServiceControl<EndpointsView[]>(`endpoints`);
25+
endpoints.value = data;
26+
} catch (e) {
27+
endpoints.value = [];
28+
throw e;
29+
}
30+
}
3631

3732
async function refresh() {
3833
try {
@@ -55,6 +50,7 @@ export const useAuditStore = defineStore("AuditStore", () => {
5550

5651
return {
5752
refresh,
53+
loadEndpoints,
5854
sortBy: sortByInstances,
5955
messages,
6056
messageFilterString,

0 commit comments

Comments
 (0)