fix: project wrapper (#2589)
* fix: project wrapper * fix: project wrapper for unjoined project * chore: update store structure
This commit is contained in:
parent
4fcc4b4a01
commit
13ead7c314
6 changed files with 204 additions and 181 deletions
|
|
@ -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;
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue