action.async.js 352B

123456789101112131415
  1. import { FETCH_CONFIG } from './helper.js'
  2. export const postWorkspace = (user, apiUrl, newWorkspaceName) =>
  3. fetch(`${apiUrl}/workspaces`, {
  4. headers: {
  5. 'Authorization': 'Basic ' + user.auth,
  6. ...FETCH_CONFIG.headers
  7. },
  8. method: 'POST',
  9. body: JSON.stringify({
  10. label: newWorkspaceName,
  11. description: ''
  12. })
  13. })