Skip to content

Commit af7524c

Browse files
committed
feat: add support for uploadedBy in deployment chart list api
1 parent 4151d87 commit af7524c

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

src/Pages/GlobalConfigurations/DeploymentCharts/types.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
export type DeploymentChartListDTO = Array<{
1+
interface DeploymentChartInfo {
22
id: number
33
chartDescription?: string
44
isUserUploaded: boolean
55
name: string
66
version: string
7-
}>
7+
uploadedBy: string
8+
}
89

9-
interface DeploymentChartVersionsType {
10-
id: number
11-
version: string
10+
export type DeploymentChartListDTO = DeploymentChartInfo[]
11+
12+
interface DeploymentChartVersionsType
13+
extends Pick<DeploymentChartInfo, 'id' | 'version' | 'uploadedBy' | 'isUserUploaded'> {
1214
description: string
1315
}
1416

15-
export interface DeploymentChartType {
16-
name: string
17-
isUserUploaded: boolean
17+
export interface DeploymentChartType extends Pick<DeploymentChartInfo, 'name' | 'isUserUploaded'> {
1818
versions: DeploymentChartVersionsType[]
1919
}
2020

src/Pages/GlobalConfigurations/DeploymentCharts/utils.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export const convertDeploymentChartListToChartType = (data: DeploymentChartListD
77
return []
88
}
99
const chartMap = data.reduce(
10-
(acc, { id, version, chartDescription: description = '', name, isUserUploaded = true }) => {
10+
(acc, { id, version, chartDescription: description = '', name, isUserUploaded = true, uploadedBy = '' }) => {
1111
if (!name || !id || !version) {
1212
return acc
1313
}
@@ -17,12 +17,14 @@ export const convertDeploymentChartListToChartType = (data: DeploymentChartListD
1717
id,
1818
version,
1919
description,
20+
uploadedBy,
21+
isUserUploaded,
2022
})
2123
} else {
2224
acc[name] = {
2325
name,
2426
isUserUploaded,
25-
versions: [{ id, version, description }],
27+
versions: [{ id, version, description, uploadedBy, isUserUploaded }],
2628
}
2729
}
2830
return acc

0 commit comments

Comments
 (0)