fix: leave project mutation (#5175)
This commit is contained in:
parent
eca79f33b6
commit
1956da2b90
1 changed files with 4 additions and 8 deletions
|
|
@ -249,14 +249,10 @@ export class UserMembershipStore implements IUserMembershipStore {
|
|||
*/
|
||||
leaveProject = async (workspaceSlug: string, projectId: string) =>
|
||||
await this.userService.leaveProject(workspaceSlug, projectId).then(() => {
|
||||
const newPermissions: { [projectId: string]: boolean } = {};
|
||||
newPermissions[projectId] = false;
|
||||
runInAction(() => {
|
||||
this.hasPermissionToProject = {
|
||||
...this.hasPermissionToProject,
|
||||
...newPermissions,
|
||||
};
|
||||
});
|
||||
// remove the user membership for a project
|
||||
set(this.hasPermissionToProject, [projectId], false);
|
||||
// update the project member list with the new permissions
|
||||
set(this.store.projectRoot.project.projectMap, [projectId, "is_member"], false);
|
||||
});
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue