mirror of
https://github.com/makeplane/plane
synced 2025-08-07 19:59:33 +00:00
fix: leave project mutation (#5175)
This commit is contained in:
committed by
GitHub
parent
eca79f33b6
commit
1956da2b90
@@ -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);
|
||||
});
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user