diff --git a/app/opportunities/[opportunity_id]/review/new/page.tsx b/app/opportunities/[opportunity_id]/review/new/page.tsx index 924e6583..5b65d949 100644 --- a/app/opportunities/[opportunity_id]/review/new/page.tsx +++ b/app/opportunities/[opportunity_id]/review/new/page.tsx @@ -42,13 +42,12 @@ export default async function StartReview({ params }: StartReviewProps) { ); // User has not reviewed questionnaire and application together - const hasNotReviewed = - questionnaire.reviews.filter( - (review) => - review.userId === session.user.id && - review.questionnaireId === questionnaire.id && - review.applicationId === application.id, - ).length === 0; + const hasNotReviewed = !questionnaire.reviews.some( + (review) => + review.userId === session.user.id && + review.questionnaireId === questionnaire.id && + review.applicationId === application.id, + ); const lessReviewsThanRequired = questionnaire.reviews.filter( diff --git a/lib/faker/applications.ts b/lib/faker/applications.ts index e1fdbf14..fd1aa9d0 100644 --- a/lib/faker/applications.ts +++ b/lib/faker/applications.ts @@ -75,7 +75,9 @@ function generateTallyData(): TallyData { formId: faker.string.nanoid(6), formName: faker.science.chemicalElement().name, createdAt: now.toISOString(), - fields: Array.from({ length: 2 }, () => generateTallyField()), + fields: Array.from({ length: faker.number.int({ min: 3, max: 6 }) }, () => + generateTallyField(), + ), }; }