[WEB-3829]fix: update workspace store action (#6905)
This commit is contained in:
parent
d347269afb
commit
0ae57b49d2
1 changed files with 9 additions and 5 deletions
|
|
@ -162,11 +162,15 @@ export class WorkspaceRootStore implements IWorkspaceRootStore {
|
|||
* @param data
|
||||
*/
|
||||
updateWorkspace = async (workspaceSlug: string, data: Partial<IWorkspace>) =>
|
||||
await this.workspaceService.updateWorkspace(workspaceSlug, data).then((response) => {
|
||||
runInAction(() => {
|
||||
set(this.workspaces, response.id, response);
|
||||
});
|
||||
return response;
|
||||
await this.workspaceService.updateWorkspace(workspaceSlug, data).then((res) => {
|
||||
if (res && res.id) {
|
||||
runInAction(() => {
|
||||
Object.keys(data).forEach((key) => {
|
||||
set(this.workspaces, [res.id, key], data[key as keyof IWorkspace]);
|
||||
});
|
||||
});
|
||||
}
|
||||
return res;
|
||||
});
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue