Skip to content

Commit

Permalink
chore(api): move id up from first job in sequence
Browse files Browse the repository at this point in the history
  • Loading branch information
ismay committed Feb 21, 2023
1 parent 4a753e8 commit 37a3a81
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions src/pages/JobList/JobListContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ const JobListContainer = () => {
const [showSystemJobs, setShowSystemJobs] = hooks.useShowSystemJobs()
const jobs = hooks.useJobListJobs()

// Move id of the first job up
jobs.map(job => {
const id = job.sequence[0]?.id
job.id = id
})

return (
<JobList
jobs={jobs}
Expand Down
4 changes: 2 additions & 2 deletions src/pages/JobList/JobListContainer.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ describe('<JobListContainer>', () => {
it('renders without errors when there is data', () => {
const store = {
jobs: [
{ id: 'one', name: 'one' },
{ id: 'two', name: 'two' },
{ sequence: [{ id: 'one' }], name: 'one' },
{ sequence: [{ id: 'two' }], name: 'two' },
],
jobFilter: ['', () => {}],
showSystemJobs: [false, () => {}],
Expand Down

0 comments on commit 37a3a81

Please sign in to comment.