[offers][chore] Add a secondary sorting by monthYearReceived descending in addition to other primary sorting filters applied

pull/422/head
Bryann Yeap Kok Keong 2 years ago
parent 3f6ae58374
commit 65a8618e54

@ -103,22 +103,32 @@ export const offersRouter = createRouter().query('list', {
monthYearReceived: order, monthYearReceived: order,
} }
: sortingKey === sortingKeysMap.totalCompensation : sortingKey === sortingKeysMap.totalCompensation
? { ? [
offersIntern: { {
monthlySalary: { offersIntern: {
baseValue: order, monthlySalary: {
baseValue: order,
},
}, },
}, },
} {
monthYearReceived: 'desc',
},
]
: sortingKey === sortingKeysMap.totalYoe : sortingKey === sortingKeysMap.totalYoe
? { ? [
profile: { {
background: { profile: {
totalYoe: order, background: {
totalYoe: order,
},
}, },
}, },
} {
: undefined, monthYearReceived: 'desc',
},
]
: { monthYearReceived: 'desc' },
where: { where: {
AND: [ AND: [
{ {
@ -207,22 +217,32 @@ export const offersRouter = createRouter().query('list', {
monthYearReceived: order, monthYearReceived: order,
} }
: sortingKey === sortingKeysMap.totalCompensation : sortingKey === sortingKeysMap.totalCompensation
? { ? [
offersFullTime: { {
totalCompensation: { offersIntern: {
baseValue: order, monthlySalary: {
baseValue: order,
},
}, },
}, },
} {
monthYearReceived: 'desc',
},
]
: sortingKey === sortingKeysMap.totalYoe : sortingKey === sortingKeysMap.totalYoe
? { ? [
profile: { {
background: { profile: {
totalYoe: order, background: {
totalYoe: order,
},
}, },
}, },
} {
: undefined, monthYearReceived: 'desc',
},
]
: { monthYearReceived: 'desc' },
where: { where: {
AND: [ AND: [
{ {

Loading…
Cancel
Save