Skip to content

Commit

Permalink
Revert "Correct ordering of OoS bed revisions"
Browse files Browse the repository at this point in the history
  • Loading branch information
richpjames authored Jul 10, 2024
1 parent 3eb601d commit b0f2000
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion server/utils/outOfServiceBedUtils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -253,9 +253,9 @@ describe('outOfServiceBedUtils', () => {
describe('sortOutOfServiceBedRevisionsByUpdatedAt', () => {
it('sorts revisions by updatedAt in descending order', () => {
const revisions = [
outOfServiceBedRevisionFactory.build({ updatedAt: '2024-01-01T00:00:00Z' }),
outOfServiceBedRevisionFactory.build({ updatedAt: '2024-01-02T00:00:00Z' }),
outOfServiceBedRevisionFactory.build({ updatedAt: '2024-01-03T00:00:00Z' }),
outOfServiceBedRevisionFactory.build({ updatedAt: '2024-01-01T00:00:00Z' }),
]
const sortedRevisions = sortOutOfServiceBedRevisionsByUpdatedAt(revisions)

Expand Down
2 changes: 1 addition & 1 deletion server/utils/outOfServiceBedUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,6 @@ export const bedRevisionDetails = (revision: Cas1OutOfServiceBedRevision): Summa

export const sortOutOfServiceBedRevisionsByUpdatedAt = (revisions: Array<Cas1OutOfServiceBedRevision>) => {
return revisions.sort((a, b) => {
return a.updatedAt < b.updatedAt ? -1 : 1
return a.updatedAt > b.updatedAt ? -1 : 1
})
}

0 comments on commit b0f2000

Please sign in to comment.