@@ -9,14 +9,12 @@ import type { ListResponse } from '@/api-clients/_common/schema/api-verbs/list';
9
9
import type { ServiceListParameters } from '@/schema/alert-manager/service/api-verbs/list' ;
10
10
import type { ServiceModel } from '@/schema/alert-manager/service/model' ;
11
11
12
- import { useDomainStore } from '@/store/domain/domain-store' ;
13
12
import type {
14
13
ReferenceLoadOptions , ReferenceItem , ReferenceMap ,
15
14
ReferenceTypeInfo ,
16
15
} from '@/store/reference/type' ;
17
16
import { useUserStore } from '@/store/user/user-store' ;
18
17
19
- import config from '@/lib/config' ;
20
18
import { useIsAlertManagerV2Enabled } from '@/lib/config/composables/use-is-alert-manager-v2-enabled' ;
21
19
import { MANAGED_VARIABLE_MODELS } from '@/lib/variable-models/managed-model-config/base-managed-model-config' ;
22
20
@@ -30,7 +28,6 @@ let lastLoadedTime = 0;
30
28
31
29
export const useServiceReferenceStore = defineStore ( 'reference-service' , ( ) => {
32
30
const userStore = useUserStore ( ) ;
33
- const domainStore = useDomainStore ( ) ;
34
31
const isAlertManagerV2Enabled = useIsAlertManagerV2Enabled ( ) ;
35
32
36
33
const state = reactive ( {
@@ -52,9 +49,6 @@ export const useServiceReferenceStore = defineStore('reference-service', () => {
52
49
} ) ;
53
50
54
51
const load = async ( options ?: ReferenceLoadOptions ) => {
55
- const isAlertManagerVersionV2 = ( config . get ( 'ADVANCED_SERVICE' ) ?. alert_manager_v2 ?? [ ] ) . includes ( domainStore . state . domainId ) ;
56
- if ( ! isAlertManagerVersionV2 ) return ;
57
-
58
52
const currentTime = new Date ( ) . getTime ( ) ;
59
53
60
54
if (
@@ -69,7 +63,7 @@ export const useServiceReferenceStore = defineStore('reference-service', () => {
69
63
} ,
70
64
} ;
71
65
72
- if ( ! isAlertManagerV2Enabled ) return ;
66
+ if ( ! isAlertManagerV2Enabled . value ) return ;
73
67
try {
74
68
const { results } = await SpaceConnector . clientV2 . alertManager . service . list < ServiceListParameters , ListResponse < ServiceModel > > ( params ) ;
75
69
0 commit comments