fix: prompt user on actions with no permission

This commit is contained in:
liyasthomas
2021-11-01 17:51:01 +05:30
parent b7e0169c9b
commit 7366b32349
4 changed files with 86 additions and 70 deletions

View File

@@ -108,19 +108,18 @@ export const updatesDef: GraphCacheUpdaters = {
},
removeTeamMember: (_result, { teamID, userUid }, cache) => {
const newMembers = (
cache.resolve(
(cache.resolve(
{
__typename: "Team",
id: teamID,
},
"teamMembers"
) as string[]
) as string[]) ?? []
)
.map((x) => [x, cache.resolve(x, "user") as string])
.map(([key, userKey]) => [key, cache.resolve(userKey, "uid") as string])
.filter(([_key, uid]) => uid !== userUid)
.map(([key]) => key)
cache.link({ __typename: "Team", id: teamID }, "teamMembers", newMembers)
},
createTeamInvitation: (result, _args, cache, _info) => {