aboutsummaryrefslogtreecommitdiffstats
path: root/src/features/workspaces/api.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/features/workspaces/api.js')
-rw-r--r--src/features/workspaces/api.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/features/workspaces/api.js b/src/features/workspaces/api.js
index fabc12455..733cb5593 100644
--- a/src/features/workspaces/api.js
+++ b/src/features/workspaces/api.js
@@ -1,3 +1,4 @@
1import { pick } from 'lodash';
1import { sendAuthRequest } from '../../api/utils/auth'; 2import { sendAuthRequest } from '../../api/utils/auth';
2import { API, API_VERSION } from '../../environment'; 3import { API, API_VERSION } from '../../environment';
3 4
@@ -25,4 +26,14 @@ export default {
25 if (!request.ok) throw request; 26 if (!request.ok) throw request;
26 return request.json(); 27 return request.json();
27 }, 28 },
29
30 updateWorkspace: async (workspace) => {
31 const url = `${API}/${API_VERSION}/workspace/${workspace.id}`;
32 const request = await sendAuthRequest(url, {
33 method: 'PUT',
34 body: JSON.stringify(pick(workspace, ['name', 'services'])),
35 });
36 if (!request.ok) throw request;
37 return request.json();
38 },
28}; 39};