[resumes][refactor] rename variables

pull/320/head
Terence Ho 3 years ago
parent 3d72bc7b23
commit 643c02d779

@ -24,10 +24,12 @@ export default function CommentsList({
const { data: session } = useSession();
// Fetch the most updated comments to render
trpc.useQuery(['resumes.reviews.list', { resumeId, tab }], {
trpc.useQuery(['resumes.reviews.list', { resumeId, section: tab }], {
onSuccess: setComments,
});
// TODO: Add loading prompt
return (
<div className="space-y-3">
<CommentsListButton setShowCommentsForm={setShowCommentsForm} />

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

Loading…
Cancel
Save