Skip to content

Commit

Permalink
Sort jobs by ID in REST mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Loskir committed Apr 5, 2022
1 parent 168ce3f commit 5b8d637
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions extensions/gitlab/src/components/jobs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -246,9 +246,8 @@ export function useSearch(
const projectUE = encodeURIComponent(projectFullPath);
const jobs: RESTJob[] = await gitlab
.fetch(`projects/${projectUE}/pipelines/${pipelineID}/jobs`)
.then((data) => {
return data.map((j: any) => j as RESTJob);
});
.then((data) => data as RESTJob[]);
jobs.sort((a, b) => a.id - b.id);
const stages: Record<string, Job[]> = {};
for (const job of jobs) {
if (!stages[job.stage]) {
Expand Down

0 comments on commit 5b8d637

Please sign in to comment.