|
14 | 14 | * limitations under the License.
|
15 | 15 | */
|
16 | 16 |
|
17 |
| -import { get, post, put, trash, sortCallback, ResponseType, getUrlWithSearchParams } from '@devtron-labs/devtron-fe-common-lib' |
| 17 | +import { |
| 18 | + get, |
| 19 | + post, |
| 20 | + put, |
| 21 | + trash, |
| 22 | + sortCallback, |
| 23 | + ResponseType, |
| 24 | + getUrlWithSearchParams, |
| 25 | +} from '@devtron-labs/devtron-fe-common-lib' |
18 | 26 | import { DELETE_ACTION, Routes } from '../../config'
|
19 | 27 | import { getAPIOptionsWithTriggerTimeout, handleUTCTime } from '../common'
|
20 |
| -import { ChartValuesType, ChartGroup, HelmTemplateChartRequest, HelmProjectUpdatePayload, DeleteInstalledChartParamsType } from './charts.types' |
| 28 | +import { |
| 29 | + ChartValuesType, |
| 30 | + ChartGroup, |
| 31 | + HelmTemplateChartRequest, |
| 32 | + HelmProjectUpdatePayload, |
| 33 | + DeleteInstalledChartParamsType, |
| 34 | +} from './charts.types' |
21 | 35 | import { SavedValueListResponse } from './SavedValues/types'
|
22 | 36 |
|
23 | 37 | interface RootObject {
|
@@ -59,19 +73,17 @@ export function deleteInstalledChart(
|
59 | 73 | ) {
|
60 | 74 | const baseUrl: string = `app-store/deployment/application/delete/${installedAppId}`
|
61 | 75 | let params: DeleteInstalledChartParamsType = {}
|
62 |
| - const url = getUrlWithSearchParams(baseUrl, params) |
63 | 76 | if (deleteAction === DELETE_ACTION.FORCE_DELETE) {
|
64 | 77 | params = {
|
65 |
| - forceDelete: true |
| 78 | + forceDelete: true, |
66 | 79 | }
|
67 | 80 | } else if (isGitops) {
|
68 |
| - deleteAction === DELETE_ACTION.NONCASCADE_DELETE ? params = { |
69 |
| - partialDelete: true, |
70 |
| - cascade: false |
71 |
| - } : params = { |
72 |
| - partialDelete: true |
| 81 | + params['partialDelete'] = true |
| 82 | + if (deleteAction === DELETE_ACTION.NONCASCADE_DELETE) { |
| 83 | + params['cascade'] = false |
73 | 84 | }
|
74 | 85 | }
|
| 86 | + const url = getUrlWithSearchParams(baseUrl, params) |
75 | 87 | return trash(url)
|
76 | 88 | }
|
77 | 89 |
|
|
0 commit comments