|
|
@ -1,5 +1,4 @@
|
|
|
|
import { z } from 'zod';
|
|
|
|
import { z } from 'zod';
|
|
|
|
import { ResumesSection } from '@prisma/client';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import { createRouter } from './context';
|
|
|
|
import { createRouter } from './context';
|
|
|
|
|
|
|
|
|
|
|
@ -8,11 +7,10 @@ import type { ResumeComment } from '~/types/resume-comments';
|
|
|
|
export const resumeReviewsRouter = createRouter().query('list', {
|
|
|
|
export const resumeReviewsRouter = createRouter().query('list', {
|
|
|
|
input: z.object({
|
|
|
|
input: z.object({
|
|
|
|
resumeId: z.string(),
|
|
|
|
resumeId: z.string(),
|
|
|
|
section: z.nativeEnum(ResumesSection),
|
|
|
|
|
|
|
|
}),
|
|
|
|
}),
|
|
|
|
async resolve({ ctx, input }) {
|
|
|
|
async resolve({ ctx, input }) {
|
|
|
|
const userId = ctx.session?.user?.id;
|
|
|
|
const userId = ctx.session?.user?.id;
|
|
|
|
const { resumeId, section } = input;
|
|
|
|
const { resumeId } = input;
|
|
|
|
|
|
|
|
|
|
|
|
// For this resume, we retrieve every comment's information, along with:
|
|
|
|
// For this resume, we retrieve every comment's information, along with:
|
|
|
|
// The user's name and image to render
|
|
|
|
// The user's name and image to render
|
|
|
@ -42,7 +40,6 @@ export const resumeReviewsRouter = createRouter().query('list', {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
where: {
|
|
|
|
where: {
|
|
|
|
resumeId,
|
|
|
|
resumeId,
|
|
|
|
section,
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|