Skip to content

Commit 5390c46

Browse files
committed
feat: add parsing in chart list api
1 parent 0cc3333 commit 5390c46

File tree

1 file changed

+7
-7
lines changed
  • src/Pages/GlobalConfigurations/DeploymentCharts

1 file changed

+7
-7
lines changed

src/Pages/GlobalConfigurations/DeploymentCharts/utils.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ export const convertDeploymentChartListToChartType = (data: DeploymentChartListD
2222
if (!data) {
2323
return []
2424
}
25-
const chartMap = data.reduce(
26-
(acc, { id, version, chartDescription: description = '', name, isUserUploaded = true, uploadedBy = '' }) => {
25+
const chartMap = data.reduce<Record<string, DeploymentChartType>>(
26+
(acc, { id, version, chartDescription, name, isUserUploaded, uploadedBy }) => {
2727
if (!name || !id || !version) {
2828
return acc
2929
}
@@ -32,8 +32,8 @@ export const convertDeploymentChartListToChartType = (data: DeploymentChartListD
3232
detail.versions.push({
3333
id,
3434
version,
35-
description,
36-
uploadedBy: isUserUploaded ? uploadedBy : 'Devtron',
35+
description: chartDescription || '',
36+
uploadedBy: isUserUploaded ? uploadedBy || '' : 'Devtron',
3737
isUserUploaded,
3838
})
3939
} else {
@@ -43,9 +43,9 @@ export const convertDeploymentChartListToChartType = (data: DeploymentChartListD
4343
{
4444
id,
4545
version,
46-
description,
47-
uploadedBy: isUserUploaded ? uploadedBy : 'Devtron',
48-
isUserUploaded,
46+
description: chartDescription || '',
47+
uploadedBy: isUserUploaded ? uploadedBy || '' : 'Devtron',
48+
isUserUploaded: isUserUploaded || true,
4949
},
5050
],
5151
}

0 commit comments

Comments
 (0)