[offers][chore] Add sorting dashboard offers by job title

pull/541/head
Bryann Yeap Kok Keong 2 years ago
parent a395dcee34
commit 6db6c5f3c3

@ -18,6 +18,7 @@ const getOrder = (prefix: string) => {
const sortingKeysMap = { const sortingKeysMap = {
companyName: 'companyName', companyName: 'companyName',
jobTitle: 'jobTitle',
monthYearReceived: 'monthYearReceived', monthYearReceived: 'monthYearReceived',
totalCompensation: 'totalCompensation', totalCompensation: 'totalCompensation',
totalYoe: 'totalYoe', totalYoe: 'totalYoe',
@ -146,6 +147,20 @@ export const offersRouter = createRouter().query('list', {
name: order, name: order,
}, },
}, },
{
monthYearReceived: 'desc',
},
]
: sortingKey === sortingKeysMap.jobTitle
? [
{
offersIntern: {
title: order,
},
},
{
monthYearReceived: 'desc',
},
] ]
: { monthYearReceived: 'desc' }, : { monthYearReceived: 'desc' },
where: { where: {
@ -284,6 +299,20 @@ export const offersRouter = createRouter().query('list', {
name: order, name: order,
}, },
}, },
{
monthYearReceived: 'desc',
},
]
: sortingKey === sortingKeysMap.jobTitle
? [
{
offersFullTime: {
title: order,
},
},
{
monthYearReceived: 'desc',
},
] ]
: { monthYearReceived: 'desc' }, : { monthYearReceived: 'desc' },
where: { where: {

Loading…
Cancel
Save