fix: leave project mutation (#5175)

This commit is contained in:
Anmol Singh Bhatia 2024-07-22 15:06:10 +05:30 committed by GitHub
parent eca79f33b6
commit 1956da2b90
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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);
});
/**