fix: project wrapper (#2589)

* fix: project wrapper

* fix: project wrapper for unjoined project

* chore: update store structure
This commit is contained in:
Aaryan Khandelwal 2023-11-01 17:10:10 +05:30 committed by GitHub
parent 4fcc4b4a01
commit 13ead7c314
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 204 additions and 181 deletions

View file

@ -522,6 +522,11 @@ export class ProjectStore implements IProjectStore {
};
joinProject = async (workspaceSlug: string, projectIds: string[]) => {
const newPermissions: { [projectId: string]: boolean } = {};
projectIds.forEach((projectId) => {
newPermissions[projectId] = true;
});
try {
this.loader = true;
this.error = null;
@ -530,6 +535,10 @@ export class ProjectStore implements IProjectStore {
await this.fetchProjects(workspaceSlug);
runInAction(() => {
this.rootStore.user.hasPermissionToProject = {
...this.rootStore.user.hasPermissionToProject,
...newPermissions,
};
this.loader = false;
this.error = null;
});