Skip to content

Commit

Permalink
Add orderBy for licence purposes to match legacy page
Browse files Browse the repository at this point in the history
  • Loading branch information
rvsiyad committed Oct 18, 2024
1 parent 51c7c13 commit 3ff9e0b
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions app/services/licences/fetch-licence-purposes.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,17 @@ async function _fetchLicencePurposes (licenceId) {
.modify('currentVersion')
.withGraphFetched('licenceVersions.licenceVersionPurposes')
.modifyGraph('licenceVersions.licenceVersionPurposes', (builder) => {
builder
.select([
'abstractionPeriodStartDay',
'abstractionPeriodStartMonth',
'abstractionPeriodEndDay',
'abstractionPeriodEndMonth',
'annualQuantity',
'dailyQuantity',
'hourlyQuantity',
'instantQuantity'
])
.orderBy('createdAt', 'desc')
builder.select([
'abstractionPeriodStartDay',
'abstractionPeriodStartMonth',
'abstractionPeriodEndDay',
'abstractionPeriodEndMonth',
'annualQuantity',
'dailyQuantity',
'hourlyQuantity',
'instantQuantity'
])
.orderBy('licenceVersionPurposes.createdAt', 'asc')
})
.withGraphFetched('licenceVersions.licenceVersionPurposes.points')
.modifyGraph('licenceVersions.licenceVersionPurposes.points', (builder) => {
Expand All @@ -52,6 +51,7 @@ async function _fetchLicencePurposes (licenceId) {
'points.ngr3',
'points.ngr4'
])
.orderBy('points.externalId', 'asc')
})
.withGraphFetched('licenceVersions.licenceVersionPurposes.points.source')
.modifyGraph('licenceVersions.licenceVersionPurposes.points.source', (builder) => {
Expand Down

0 comments on commit 3ff9e0b

Please sign in to comment.