From 01df1d3a6ac1dbb2e504b258dcea87fbb945ec83 Mon Sep 17 00:00:00 2001 From: mattcasey Date: Thu, 5 Dec 2024 12:34:24 -0700 Subject: [PATCH] . --- .../permissions/getSpaceInfoViaResource.ts | 36 +++++++++---------- src/lib/testing/proposals.ts | 23 ++++++------ src/lib/testing/spaces.ts | 22 ++++++------ src/prisma/schema.prisma | 2 +- 4 files changed, 41 insertions(+), 42 deletions(-) diff --git a/src/lib/permissions/getSpaceInfoViaResource.ts b/src/lib/permissions/getSpaceInfoViaResource.ts index 6a07a6fb..94863384 100644 --- a/src/lib/permissions/getSpaceInfoViaResource.ts +++ b/src/lib/permissions/getSpaceInfoViaResource.ts @@ -246,24 +246,24 @@ export async function getSpaceInfoViaResource({ !resourceIdType || resourceIdType === 'space' ? isSpaceOptedIn : resourceIdType === 'postCategory' - ? isPostCategorySpaceOptedIn - : resourceIdType === 'postCategoryPermission' - ? isPostCategoryPermissionSpaceOptedIn - : resourceIdType === 'post' - ? isPostSpaceOptedIn - : resourceIdType === 'proposal' - ? isProposalSpaceOptedIn - : resourceIdType === 'page' - ? isPageSpaceOptedIn - : resourceIdType === 'pagePermission' - ? isPagePermissionSpaceOptedIn - : resourceIdType === 'bounty' - ? isBountySpaceOptedIn - : resourceIdType === 'vote' - ? isVoteSpaceOptedIn - : resourceIdType === 'role' - ? isRoleSpaceOptedIn - : null; + ? isPostCategorySpaceOptedIn + : resourceIdType === 'postCategoryPermission' + ? isPostCategoryPermissionSpaceOptedIn + : resourceIdType === 'post' + ? isPostSpaceOptedIn + : resourceIdType === 'proposal' + ? isProposalSpaceOptedIn + : resourceIdType === 'page' + ? isPageSpaceOptedIn + : resourceIdType === 'pagePermission' + ? isPagePermissionSpaceOptedIn + : resourceIdType === 'bounty' + ? isBountySpaceOptedIn + : resourceIdType === 'vote' + ? isVoteSpaceOptedIn + : resourceIdType === 'role' + ? isRoleSpaceOptedIn + : null; if (!engineResolver) { throw new InvalidInputError(`Invalid resolver provided`); diff --git a/src/lib/testing/proposals.ts b/src/lib/testing/proposals.ts index bad9e1da..e421b2eb 100644 --- a/src/lib/testing/proposals.ts +++ b/src/lib/testing/proposals.ts @@ -213,18 +213,17 @@ export async function generateProposal({ ); const evaluationReviewersToCreate: Prisma.ProposalReviewerCreateManyInput[] = - evaluationInputsWithIdAndIndex.flatMap( - (input) => - input.reviewers?.map( - (reviewer) => - ({ - proposalId, - evaluationId: input.id, - roleId: reviewer.group === 'role' ? reviewer.id : undefined, - userId: reviewer.group === 'user' ? reviewer.id : undefined, - systemRole: ProposalSystemRole[reviewer.group as ProposalSystemRole] ? reviewer.group : undefined - }) as Prisma.ProposalReviewerCreateManyInput - ) + evaluationInputsWithIdAndIndex.flatMap((input) => + input.reviewers?.map( + (reviewer) => + ({ + proposalId, + evaluationId: input.id, + roleId: reviewer.group === 'role' ? reviewer.id : undefined, + userId: reviewer.group === 'user' ? reviewer.id : undefined, + systemRole: ProposalSystemRole[reviewer.group as ProposalSystemRole] ? reviewer.group : undefined + }) as Prisma.ProposalReviewerCreateManyInput + ) ); const evaluationAppealReviewersToCreate: Prisma.ProposalAppealReviewerCreateManyInput[] = diff --git a/src/lib/testing/spaces.ts b/src/lib/testing/spaces.ts index b3834f16..905ba0ff 100644 --- a/src/lib/testing/spaces.ts +++ b/src/lib/testing/spaces.ts @@ -64,18 +64,18 @@ export async function addSpaceOperations({ } } : group === 'role' - ? { - roleId_forSpaceId: { - roleId: id, - forSpaceId - } - } - : { - spaceId_forSpaceId: { - spaceId: id, - forSpaceId + ? { + roleId_forSpaceId: { + roleId: id, + forSpaceId + } } - }; + : { + spaceId_forSpaceId: { + spaceId: id, + forSpaceId + } + }; await prisma.spacePermission.upsert({ where: query, diff --git a/src/prisma/schema.prisma b/src/prisma/schema.prisma index 80d64717..18ad120f 100644 --- a/src/prisma/schema.prisma +++ b/src/prisma/schema.prisma @@ -2833,7 +2833,7 @@ model Scout { dailyClaimEvents ScoutDailyClaimEvent[] dailyClaimStreakEvents ScoutDailyClaimStreakEvent[] referralCode String @unique - referralCodeEvent ReferralCodeEvent[] + referralCodeEvents ReferralCodeEvent[] talentProfile TalentProfile? @@index([path])