aboutsummaryrefslogtreecommitdiffstats
path: root/src/features/workspaces
diff options
context:
space:
mode:
authorLibravatar vantezzen <properly@protonmail.com>2019-08-23 12:57:46 +0200
committerLibravatar vantezzen <properly@protonmail.com>2019-08-23 12:57:46 +0200
commited987f542626c0d7b7c5cb4ef18beeeace67885f (patch)
treebf7d0eeb25b95f7f8a5ebb1691d90df899a48d31 /src/features/workspaces
parentAutofix npm audit (diff)
downloadferdium-app-ed987f542626c0d7b7c5cb4ef18beeeace67885f.tar.gz
ferdium-app-ed987f542626c0d7b7c5cb4ef18beeeace67885f.tar.zst
ferdium-app-ed987f542626c0d7b7c5cb4ef18beeeace67885f.zip
Use API URL from store for workspaces and announcements
Diffstat (limited to 'src/features/workspaces')
-rw-r--r--src/features/workspaces/api.js10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/features/workspaces/api.js b/src/features/workspaces/api.js
index 0ec20c9ea..ff0e54a7a 100644
--- a/src/features/workspaces/api.js
+++ b/src/features/workspaces/api.js
@@ -1,14 +1,14 @@
1import { pick } from 'lodash'; 1import { pick } from 'lodash';
2import { sendAuthRequest } from '../../api/utils/auth'; 2import { sendAuthRequest } from '../../api/utils/auth';
3import { API, API_VERSION } from '../../environment';
4import Request from '../../stores/lib/Request'; 3import Request from '../../stores/lib/Request';
5import Workspace from './models/Workspace'; 4import Workspace from './models/Workspace';
5import apiBase from '../apiBase'
6 6
7const debug = require('debug')('Franz:feature:workspaces:api'); 7const debug = require('debug')('Franz:feature:workspaces:api');
8 8
9export const workspaceApi = { 9export const workspaceApi = {
10 getUserWorkspaces: async () => { 10 getUserWorkspaces: async () => {
11 const url = `${API}/${API_VERSION}/workspace`; 11 const url = `${apiBase()}/workspace`;
12 debug('getUserWorkspaces GET', url); 12 debug('getUserWorkspaces GET', url);
13 const result = await sendAuthRequest(url, { method: 'GET' }); 13 const result = await sendAuthRequest(url, { method: 'GET' });
14 debug('getUserWorkspaces RESULT', result); 14 debug('getUserWorkspaces RESULT', result);
@@ -18,7 +18,7 @@ export const workspaceApi = {
18 }, 18 },
19 19
20 createWorkspace: async (name) => { 20 createWorkspace: async (name) => {
21 const url = `${API}/${API_VERSION}/workspace`; 21 const url = `${apiBase()}/workspace`;
22 const options = { 22 const options = {
23 method: 'POST', 23 method: 'POST',
24 body: JSON.stringify({ name }), 24 body: JSON.stringify({ name }),
@@ -31,7 +31,7 @@ export const workspaceApi = {
31 }, 31 },
32 32
33 deleteWorkspace: async (workspace) => { 33 deleteWorkspace: async (workspace) => {
34 const url = `${API}/${API_VERSION}/workspace/${workspace.id}`; 34 const url = `${apiBase()}/workspace/${workspace.id}`;
35 debug('deleteWorkspace DELETE', url); 35 debug('deleteWorkspace DELETE', url);
36 const result = await sendAuthRequest(url, { method: 'DELETE' }); 36 const result = await sendAuthRequest(url, { method: 'DELETE' });
37 debug('deleteWorkspace RESULT', result); 37 debug('deleteWorkspace RESULT', result);
@@ -40,7 +40,7 @@ export const workspaceApi = {
40 }, 40 },
41 41
42 updateWorkspace: async (workspace) => { 42 updateWorkspace: async (workspace) => {
43 const url = `${API}/${API_VERSION}/workspace/${workspace.id}`; 43 const url = `${apiBase()}/workspace/${workspace.id}`;
44 const options = { 44 const options = {
45 method: 'PUT', 45 method: 'PUT',
46 body: JSON.stringify(pick(workspace, ['name', 'services'])), 46 body: JSON.stringify(pick(workspace, ['name', 'services'])),