aboutsummaryrefslogtreecommitdiffstats
path: root/src/features/workspaces/api.js
blob: 97badbd01293ef215173d02df67f0b29f4b918e1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
import { prepareAuthRequest } from '../../api/utils/auth';
import { API, API_VERSION } from '../../environment';

export default {
  getUserWorkspaces: async () => {
    const url = `${API}/${API_VERSION}/workspace`;
    const request = await window.fetch(url, prepareAuthRequest({
      method: 'GET',
    }));
    if (!request.ok) throw request;
    return request.json();
  },
};