Merge branch 'main' of github.com:yangshun/tech-interview-handbook

pull/543/head
Jeff Sieu 2 years ago
commit 65c4254dad

@ -23,14 +23,13 @@ const seedAnalysis = async () => {
while (i < profilesWithoutAnalysis.length) { while (i < profilesWithoutAnalysis.length) {
const profile = profilesWithoutAnalysis[i]; const profile = profilesWithoutAnalysis[i];
await generateAnalysis({ await generateAnalysis({
ctx: { prisma, session: null }, ctx: { prisma, session: null },
input: { profileId: profile.id }, input: { profileId: profile.id },
}); });
i++; console.log(++i, ': Analysis generated for profile with id', profile.id);
console.log(i, ': Analysis generated for profile with id', profile.id);
} }
console.log(i, 'analysis generated'); console.log(i, 'analysis generated');

@ -106,7 +106,7 @@ export default function ResumeHomePage() {
'', '',
); );
const [shortcutSelected, setShortcutSelected, isShortcutInit] = const [shortcutSelected, setShortcutSelected, isShortcutInit] =
useSearchParams('shortcutSelected', 'Unreviewed'); useSearchParams('shortcutSelected', 'General');
const [currentPage, setCurrentPage, isCurrentPageInit] = useSearchParams( const [currentPage, setCurrentPage, isCurrentPageInit] = useSearchParams(
'currentPage', 'currentPage',
1, 1,

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

@ -97,7 +97,7 @@ export const EXPERIENCES: Array<TypeaheadOption> = [
export const INITIAL_FILTER_STATE: FilterState = { export const INITIAL_FILTER_STATE: FilterState = {
experience: [], experience: [],
isTop10: false, isTop10: false,
isUnreviewed: true, isUnreviewed: false,
location: [], location: [],
role: [], role: [],
}; };
@ -106,7 +106,6 @@ export const SHORTCUTS: Array<Shortcut> = [
{ {
filters: { filters: {
...INITIAL_FILTER_STATE, ...INITIAL_FILTER_STATE,
isUnreviewed: false,
}, },
name: 'General', name: 'General',
sortOrder: 'latest', sortOrder: 'latest',
@ -129,7 +128,6 @@ export const SHORTCUTS: Array<Shortcut> = [
value: 'entry-level', value: 'entry-level',
}, },
], ],
isUnreviewed: false,
}, },
name: 'Fresh Grad', name: 'Fresh Grad',
sortOrder: 'latest', sortOrder: 'latest',
@ -138,7 +136,6 @@ export const SHORTCUTS: Array<Shortcut> = [
filters: { filters: {
...INITIAL_FILTER_STATE, ...INITIAL_FILTER_STATE,
isTop10: true, isTop10: true,
isUnreviewed: false,
}, },
name: 'Top 10', name: 'Top 10',
sortOrder: 'popular', sortOrder: 'popular',
@ -146,7 +143,6 @@ export const SHORTCUTS: Array<Shortcut> = [
{ {
filters: { filters: {
...INITIAL_FILTER_STATE, ...INITIAL_FILTER_STATE,
isUnreviewed: false,
location: [ location: [
{ {
id: '231', id: '231',

Loading…
Cancel
Save