Skip to content

Commit 32d285f

Browse files
fix: [IDP-3021]: changing pipeline execution summary api (#124)
1 parent 98fe8d4 commit 32d285f

File tree

1 file changed

+15
-10
lines changed

1 file changed

+15
-10
lines changed

plugins/harness-ci-cd/src/hooks/useGetExecutionsList.ts

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,6 @@ const useGetExecutionsList = ({
4242
page: `${page}`,
4343
});
4444

45-
if (pipelineId && pipelineId.trim()) {
46-
pipelineId.split(',').forEach((item: string) => {
47-
const trimmedString = item.trim();
48-
if (trimmedString) {
49-
query.append('pipelineIdentifier', trimmedString);
50-
}
51-
});
52-
}
53-
5445
const token = getSecureHarnessKey('token');
5546
const value = token ? `${token}` : '';
5647

@@ -72,10 +63,24 @@ const useGetExecutionsList = ({
7263
});
7364
}
7465

66+
const identifiers: string[] = [];
67+
if (pipelineId && pipelineId.trim()) {
68+
pipelineId.split(',').forEach(item => {
69+
const trimmedString = item.trim();
70+
if (trimmedString) {
71+
identifiers.push(trimmedString);
72+
}
73+
});
74+
body = JSON.stringify({
75+
filterType: 'PipelineExecution',
76+
pipelineIdentifiers: identifiers,
77+
});
78+
}
79+
7580
setStatus(AsyncStatus.Loading);
7681

7782
const response = await fetch(
78-
`${await backendBaseUrl}/harness/${env}/gateway/pipeline/api/pipelines/execution/v2/summary?${query}`,
83+
`${await backendBaseUrl}/harness/${env}/gateway/pipeline/api/pipelines/execution/summary?${query}`,
7984
{
8085
headers,
8186
method: 'POST',

0 commit comments

Comments
 (0)