feat: Pending members selection (#10168)

* Pending members selection

* Discard changes to .vscode/launch.json

* revert yarn.lock

---------

Co-authored-by: Omar López <[email protected]>
This commit is contained in:
Leo GiovanettiandOmar López authored and GitHub committed 2023-07-20 11:23:15 +05:30
1 parent d2104dac5a
commit 8ba4b4d50e
5 files changed
+38 -24

No files matched your search

@@ -67,6 +67,7 @@ export const updateHandler = async ({ ctx, input }: UpdateOptions) => {
select: {
name: true,
id: true,
parentId: true,
},
},
},
@@ -187,7 +188,8 @@ export const updateHandler = async ({ ctx, input }: UpdateOptions) => {
const teamMemberIds = memberships.map((membership) => membership.userId);
// guard against missing IDs, this may mean a member has just been removed
// or this request was forged.
if (!hosts.every((host) => teamMemberIds.includes(host.userId))) {
// we let this pass through on organization sub-teams
if (!hosts.every((host) => teamMemberIds.includes(host.userId)) && !eventType.team?.parentId) {
throw new TRPCError({
code: "FORBIDDEN",
});