File tree Expand file tree Collapse file tree 3 files changed +20
-4
lines changed
components/app/details/appDetails Expand file tree Collapse file tree 3 files changed +20
-4
lines changed Original file line number Diff line number Diff line change @@ -20,18 +20,24 @@ import { fetchWithFullRoute } from '../../../../services/fetchWithFullRoute'
20
20
import {
21
21
ClusterConnectionResponse ,
22
22
DataSourceDetailsDTO ,
23
+ DataSourceDetailsQueryParams ,
24
+ DataSourceDetailsType ,
23
25
DeploymentStatusDetailsResponse ,
24
26
ModuleConfigResponse ,
25
27
} from './appDetails.type'
26
28
import { AppType } from '../../../v2/appDetails/appDetails.type'
27
29
28
- export const getDataSourceDetailsFromEnvironment = async ( envName : string ) : Promise < DataSourceDetailsDTO > => {
30
+ export const getDataSourceDetailsFromEnvironment = async ( envName : string ) : Promise < DataSourceDetailsType > => {
29
31
try {
30
32
const {
31
- result : { dataSourceName, dataSourceId } ,
32
- } = await get < DataSourceDetailsDTO > ( getUrlWithSearchParams ( '/health' , { envName } ) )
33
+ result : { name, id } ,
34
+ } = await get < DataSourceDetailsDTO > (
35
+ getUrlWithSearchParams ( Routes . ENV_DATA_SOURCE_NAME , {
36
+ environment : envName ,
37
+ } satisfies DataSourceDetailsQueryParams ) ,
38
+ )
33
39
34
- return { dataSourceName, dataSourceId }
40
+ return { dataSourceName : name , dataSourceId : id }
35
41
} catch {
36
42
return {
37
43
dataSourceName : '' ,
Original file line number Diff line number Diff line change @@ -133,6 +133,15 @@ export interface ModuleConfigResponse extends ResponseType {
133
133
}
134
134
135
135
export interface DataSourceDetailsDTO {
136
+ id : number
137
+ name : string
138
+ }
139
+
140
+ export interface DataSourceDetailsQueryParams {
141
+ environment : string
142
+ }
143
+
144
+ export interface DataSourceDetailsType {
136
145
dataSourceName : string
137
146
dataSourceId : number
138
147
}
Original file line number Diff line number Diff line change @@ -265,6 +265,7 @@ export const Routes = {
265
265
CONFIG_MANIFEST : 'config/manifest' ,
266
266
USER_RESOURCE_OPTIONS : 'user/resource/options' ,
267
267
HEALTH : 'health' ,
268
+ ENV_DATA_SOURCE_NAME : 'env/data-source-name' ,
268
269
}
269
270
270
271
export enum ViewType {
You can’t perform that action at this time.
0 commit comments