aboutsummaryrefslogtreecommitdiffstats
path: root/src/features/workspaces/store.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/features/workspaces/store.js')
-rw-r--r--src/features/workspaces/store.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/features/workspaces/store.js b/src/features/workspaces/store.js
index d90f9caac..a9b93f904 100644
--- a/src/features/workspaces/store.js
+++ b/src/features/workspaces/store.js
@@ -50,6 +50,7 @@ export default class WorkspacesStore extends Store {
50 50
51 this.actions.workspace.edit.listen(this._edit); 51 this.actions.workspace.edit.listen(this._edit);
52 this.actions.workspace.create.listen(this._create); 52 this.actions.workspace.create.listen(this._create);
53 this.actions.workspace.delete.listen(this._delete);
53 } 54 }
54 55
55 _setWorkspaces = (workspaces) => { 56 _setWorkspaces = (workspaces) => {
@@ -77,4 +78,14 @@ export default class WorkspacesStore extends Store {
77 throw error; 78 throw error;
78 } 79 }
79 }; 80 };
81
82 _delete = async ({ workspace }) => {
83 try {
84 await this.api.deleteWorkspace(workspace);
85 this.state.workspaces.remove(workspace);
86 this.stores.router.push('/settings/workspaces');
87 } catch (error) {
88 throw error;
89 }
90 };
80} 91}