|
|
@ -53,6 +53,7 @@ export const resumesResumeUserRouter = createProtectedRouter()
|
|
|
|
searchValue: z.string(),
|
|
|
|
searchValue: z.string(),
|
|
|
|
skip: z.number(),
|
|
|
|
skip: z.number(),
|
|
|
|
sortOrder: z.string(),
|
|
|
|
sortOrder: z.string(),
|
|
|
|
|
|
|
|
take: z.number(),
|
|
|
|
}),
|
|
|
|
}),
|
|
|
|
async resolve({ ctx, input }) {
|
|
|
|
async resolve({ ctx, input }) {
|
|
|
|
const userId = ctx.session.user.id;
|
|
|
|
const userId = ctx.session.user.id;
|
|
|
@ -64,6 +65,7 @@ export const resumesResumeUserRouter = createProtectedRouter()
|
|
|
|
sortOrder,
|
|
|
|
sortOrder,
|
|
|
|
numComments,
|
|
|
|
numComments,
|
|
|
|
skip,
|
|
|
|
skip,
|
|
|
|
|
|
|
|
take,
|
|
|
|
} = input;
|
|
|
|
} = input;
|
|
|
|
const totalRecords = await ctx.prisma.resumesStar.count({
|
|
|
|
const totalRecords = await ctx.prisma.resumesStar.count({
|
|
|
|
where: {
|
|
|
|
where: {
|
|
|
@ -76,6 +78,7 @@ export const resumesResumeUserRouter = createProtectedRouter()
|
|
|
|
experience: { in: experienceFilters },
|
|
|
|
experience: { in: experienceFilters },
|
|
|
|
location: { in: locationFilters },
|
|
|
|
location: { in: locationFilters },
|
|
|
|
role: { in: roleFilters },
|
|
|
|
role: { in: roleFilters },
|
|
|
|
|
|
|
|
title: { contains: searchValue, mode: 'insensitive' },
|
|
|
|
},
|
|
|
|
},
|
|
|
|
userId,
|
|
|
|
userId,
|
|
|
|
},
|
|
|
|
},
|
|
|
@ -121,7 +124,7 @@ export const resumesResumeUserRouter = createProtectedRouter()
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
skip,
|
|
|
|
skip,
|
|
|
|
take: 10,
|
|
|
|
take,
|
|
|
|
where: {
|
|
|
|
where: {
|
|
|
|
resume: {
|
|
|
|
resume: {
|
|
|
|
...(numComments === 0 && {
|
|
|
|
...(numComments === 0 && {
|
|
|
@ -167,6 +170,7 @@ export const resumesResumeUserRouter = createProtectedRouter()
|
|
|
|
searchValue: z.string(),
|
|
|
|
searchValue: z.string(),
|
|
|
|
skip: z.number(),
|
|
|
|
skip: z.number(),
|
|
|
|
sortOrder: z.string(),
|
|
|
|
sortOrder: z.string(),
|
|
|
|
|
|
|
|
take: z.number(),
|
|
|
|
}),
|
|
|
|
}),
|
|
|
|
async resolve({ ctx, input }) {
|
|
|
|
async resolve({ ctx, input }) {
|
|
|
|
const userId = ctx.session.user.id;
|
|
|
|
const userId = ctx.session.user.id;
|
|
|
@ -177,6 +181,7 @@ export const resumesResumeUserRouter = createProtectedRouter()
|
|
|
|
sortOrder,
|
|
|
|
sortOrder,
|
|
|
|
searchValue,
|
|
|
|
searchValue,
|
|
|
|
numComments,
|
|
|
|
numComments,
|
|
|
|
|
|
|
|
take,
|
|
|
|
skip,
|
|
|
|
skip,
|
|
|
|
} = input;
|
|
|
|
} = input;
|
|
|
|
const totalRecords = await ctx.prisma.resumesResume.count({
|
|
|
|
const totalRecords = await ctx.prisma.resumesResume.count({
|
|
|
@ -189,6 +194,7 @@ export const resumesResumeUserRouter = createProtectedRouter()
|
|
|
|
experience: { in: experienceFilters },
|
|
|
|
experience: { in: experienceFilters },
|
|
|
|
location: { in: locationFilters },
|
|
|
|
location: { in: locationFilters },
|
|
|
|
role: { in: roleFilters },
|
|
|
|
role: { in: roleFilters },
|
|
|
|
|
|
|
|
title: { contains: searchValue, mode: 'insensitive' },
|
|
|
|
userId,
|
|
|
|
userId,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
});
|
|
|
|
});
|
|
|
@ -224,7 +230,7 @@ export const resumesResumeUserRouter = createProtectedRouter()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
: { comments: { _count: 'desc' } },
|
|
|
|
: { comments: { _count: 'desc' } },
|
|
|
|
skip,
|
|
|
|
skip,
|
|
|
|
take: 10,
|
|
|
|
take,
|
|
|
|
where: {
|
|
|
|
where: {
|
|
|
|
...(numComments === 0 && {
|
|
|
|
...(numComments === 0 && {
|
|
|
|
comments: {
|
|
|
|
comments: {
|
|
|
|