@@ -38,7 +38,6 @@ import {
3838 DeploymentStatusDetailsResponse ,
3939 FetchIdDataStatus ,
4040 GetResourceConflictDetailsParamsType ,
41- // eslint-disable-next-line @typescript-eslint/no-unused-vars
4241 GetResourceListItemPayloadType ,
4342 ModuleConfigResponse ,
4443 ResourceConflictItemType ,
@@ -319,68 +318,22 @@ export const resourceConflictRedeploy = async ({ pipelineId, triggerId, appId }:
319318 } )
320319
321320export const getResourceConflictDetails = async ( {
322- // eslint-disable-next-line @typescript-eslint/no-unused-vars
323321 appId,
324- // eslint-disable-next-line @typescript-eslint/no-unused-vars
325322 pipelineId,
326- // eslint-disable-next-line @typescript-eslint/no-unused-vars
327323 triggerId,
328- // eslint-disable-next-line @typescript-eslint/no-unused-vars
329324 signal,
330325} : GetResourceConflictDetailsParamsType ) : Promise < ResourceConflictItemType [ ] > => {
331- // const { result } = await post<ResourceConflictListItemDTO, GetResourceListItemPayloadType>(
332- // ROUTES.RESOURCE_CONFLICTS_LIST,
333- // {
334- // appId: +appId,
335- // pipelineId: +pipelineId,
336- // wfrId: +triggerId,
337- // },
338- // { signal },
339- // )
340-
341- const MOCK_RESULT : ResourceConflictListItemDTO = {
342- clusterId : 1 ,
343- conflictingResources : [
344- {
345- name : 'resource-1' ,
346- namespace : 'default' ,
347- groupVersionKind : {
348- Group : 'apps' ,
349- Version : 'v1' ,
350- Kind : 'Deployment' ,
351- } ,
352- } ,
353- {
354- name : 'resource-2' ,
355- namespace : 'default' ,
356- groupVersionKind : {
357- Group : '' ,
358- Version : 'v1' ,
359- Kind : 'Service' ,
360- } ,
361- } ,
362- {
363- name : 'resource-3' ,
364- namespace : 'default' ,
365- groupVersionKind : {
366- Group : 'apps' ,
367- Version : 'v1' ,
368- Kind : 'StatefulSet' ,
369- } ,
370- } ,
371- {
372- name : 'resource-4' ,
373- namespace : 'default' ,
374- groupVersionKind : {
375- Group : 'batch' ,
376- Version : 'v1' ,
377- Kind : 'Job' ,
378- } ,
379- } ,
380- ] ,
381- }
326+ const { result } = await post < ResourceConflictListItemDTO , GetResourceListItemPayloadType > (
327+ ROUTES . RESOURCE_CONFLICTS_LIST ,
328+ {
329+ appId : + appId ,
330+ pipelineId : + pipelineId ,
331+ wfrId : + triggerId ,
332+ } ,
333+ { signal } ,
334+ )
382335
383- return ( MOCK_RESULT ?. conflictingResources || [ ] ) . map < ResourceConflictItemType > ( ( resource ) => ( {
336+ return ( result ?. conflictingResources || [ ] ) . map < ResourceConflictItemType > ( ( resource ) => ( {
384337 name : resource . name || '' ,
385338 namespace : resource . namespace || '' ,
386339 gvk : {
@@ -389,7 +342,7 @@ export const getResourceConflictDetails = async ({
389342 Kind : resource . groupVersionKind . Kind || ( '' as GVKType [ 'Kind' ] ) ,
390343 } ,
391344 gvkTitle : getGVKTitle ( resource . groupVersionKind ) ,
392- clusterId : MOCK_RESULT . clusterId ,
345+ clusterId : result . clusterId ,
393346 id : getUniqueId ( ) ,
394347 } ) )
395348}
0 commit comments