Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
mattcasey committed Dec 5, 2024
1 parent 40a8022 commit 01df1d3
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 42 deletions.
36 changes: 18 additions & 18 deletions src/lib/permissions/getSpaceInfoViaResource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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`);
Expand Down
23 changes: 11 additions & 12 deletions src/lib/testing/proposals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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[] =
Expand Down
22 changes: 11 additions & 11 deletions src/lib/testing/spaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -2833,7 +2833,7 @@ model Scout {
dailyClaimEvents ScoutDailyClaimEvent[]
dailyClaimStreakEvents ScoutDailyClaimStreakEvent[]
referralCode String @unique
referralCodeEvent ReferralCodeEvent[]
referralCodeEvents ReferralCodeEvent[]
talentProfile TalentProfile?
@@index([path])
Expand Down

0 comments on commit 01df1d3

Please sign in to comment.