|
|
|
@ -17,6 +17,8 @@ const getOrder = (prefix: string) => {
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const sortingKeysMap = {
|
|
|
|
|
companyName: 'companyName',
|
|
|
|
|
jobTitle: 'jobTitle',
|
|
|
|
|
monthYearReceived: 'monthYearReceived',
|
|
|
|
|
totalCompensation: 'totalCompensation',
|
|
|
|
|
totalYoe: 'totalYoe',
|
|
|
|
@ -138,6 +140,28 @@ export const offersRouter = createRouter().query('list', {
|
|
|
|
|
monthYearReceived: 'desc',
|
|
|
|
|
},
|
|
|
|
|
]
|
|
|
|
|
: sortingKey === sortingKeysMap.companyName
|
|
|
|
|
? [
|
|
|
|
|
{
|
|
|
|
|
company: {
|
|
|
|
|
name: order,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
monthYearReceived: 'desc',
|
|
|
|
|
},
|
|
|
|
|
]
|
|
|
|
|
: sortingKey === sortingKeysMap.jobTitle
|
|
|
|
|
? [
|
|
|
|
|
{
|
|
|
|
|
offersIntern: {
|
|
|
|
|
title: order,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
monthYearReceived: 'desc',
|
|
|
|
|
},
|
|
|
|
|
]
|
|
|
|
|
: { monthYearReceived: 'desc' },
|
|
|
|
|
where: {
|
|
|
|
|
AND: [
|
|
|
|
@ -268,6 +292,28 @@ export const offersRouter = createRouter().query('list', {
|
|
|
|
|
monthYearReceived: 'desc',
|
|
|
|
|
},
|
|
|
|
|
]
|
|
|
|
|
: sortingKey === sortingKeysMap.companyName
|
|
|
|
|
? [
|
|
|
|
|
{
|
|
|
|
|
company: {
|
|
|
|
|
name: order,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
monthYearReceived: 'desc',
|
|
|
|
|
},
|
|
|
|
|
]
|
|
|
|
|
: sortingKey === sortingKeysMap.jobTitle
|
|
|
|
|
? [
|
|
|
|
|
{
|
|
|
|
|
offersFullTime: {
|
|
|
|
|
title: order,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
monthYearReceived: 'desc',
|
|
|
|
|
},
|
|
|
|
|
]
|
|
|
|
|
: { monthYearReceived: 'desc' },
|
|
|
|
|
where: {
|
|
|
|
|
AND: [
|
|
|
|
|