mirror of
https://github.com/yangshun/tech-interview-handbook.git
synced 2025-07-28 12:43:12 +08:00
[offers][chore] Add a secondary sorting by monthYearReceived descending in addition to other primary sorting filters applied
This commit is contained in:
@ -103,22 +103,32 @@ export const offersRouter = createRouter().query('list', {
|
||||
monthYearReceived: order,
|
||||
}
|
||||
: sortingKey === sortingKeysMap.totalCompensation
|
||||
? {
|
||||
? [
|
||||
{
|
||||
offersIntern: {
|
||||
monthlySalary: {
|
||||
baseValue: order,
|
||||
},
|
||||
},
|
||||
}
|
||||
},
|
||||
{
|
||||
monthYearReceived: 'desc',
|
||||
},
|
||||
]
|
||||
: sortingKey === sortingKeysMap.totalYoe
|
||||
? {
|
||||
? [
|
||||
{
|
||||
profile: {
|
||||
background: {
|
||||
totalYoe: order,
|
||||
},
|
||||
},
|
||||
}
|
||||
: undefined,
|
||||
},
|
||||
{
|
||||
monthYearReceived: 'desc',
|
||||
},
|
||||
]
|
||||
: { monthYearReceived: 'desc' },
|
||||
where: {
|
||||
AND: [
|
||||
{
|
||||
@ -207,22 +217,32 @@ export const offersRouter = createRouter().query('list', {
|
||||
monthYearReceived: order,
|
||||
}
|
||||
: sortingKey === sortingKeysMap.totalCompensation
|
||||
? {
|
||||
offersFullTime: {
|
||||
totalCompensation: {
|
||||
? [
|
||||
{
|
||||
offersIntern: {
|
||||
monthlySalary: {
|
||||
baseValue: order,
|
||||
},
|
||||
},
|
||||
}
|
||||
},
|
||||
{
|
||||
monthYearReceived: 'desc',
|
||||
},
|
||||
]
|
||||
: sortingKey === sortingKeysMap.totalYoe
|
||||
? {
|
||||
? [
|
||||
{
|
||||
profile: {
|
||||
background: {
|
||||
totalYoe: order,
|
||||
},
|
||||
},
|
||||
}
|
||||
: undefined,
|
||||
},
|
||||
{
|
||||
monthYearReceived: 'desc',
|
||||
},
|
||||
]
|
||||
: { monthYearReceived: 'desc' },
|
||||
where: {
|
||||
AND: [
|
||||
{
|
||||
|
Reference in New Issue
Block a user