Skip to content

Commit

Permalink
fix: [IDP-3021]: changing pipeline execution summary api (#124)
Browse files Browse the repository at this point in the history
  • Loading branch information
ajinkya-harness authored Jul 15, 2024
1 parent 98fe8d4 commit 32d285f
Showing 1 changed file with 15 additions and 10 deletions.
25 changes: 15 additions & 10 deletions plugins/harness-ci-cd/src/hooks/useGetExecutionsList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,6 @@ const useGetExecutionsList = ({
page: `${page}`,
});

if (pipelineId && pipelineId.trim()) {
pipelineId.split(',').forEach((item: string) => {
const trimmedString = item.trim();
if (trimmedString) {
query.append('pipelineIdentifier', trimmedString);
}
});
}

const token = getSecureHarnessKey('token');
const value = token ? `${token}` : '';

Expand All @@ -72,10 +63,24 @@ const useGetExecutionsList = ({
});
}

const identifiers: string[] = [];
if (pipelineId && pipelineId.trim()) {
pipelineId.split(',').forEach(item => {
const trimmedString = item.trim();
if (trimmedString) {
identifiers.push(trimmedString);
}
});
body = JSON.stringify({
filterType: 'PipelineExecution',
pipelineIdentifiers: identifiers,
});
}

setStatus(AsyncStatus.Loading);

const response = await fetch(
`${await backendBaseUrl}/harness/${env}/gateway/pipeline/api/pipelines/execution/v2/summary?${query}`,
`${await backendBaseUrl}/harness/${env}/gateway/pipeline/api/pipelines/execution/summary?${query}`,
{
headers,
method: 'POST',
Expand Down

0 comments on commit 32d285f

Please sign in to comment.