1
1
// Interacts with the action endpoints
2
2
3
+ import { siteConfig } from "@/site.config" ;
3
4
import {
4
5
Action ,
5
- actionToString ,
6
6
defaultAction ,
7
7
isAction ,
8
8
isActionArray ,
@@ -21,14 +21,14 @@ export const fetchActionsByCoachingSessionId = async (
21
21
var err : string = "" ;
22
22
23
23
const data = await axios
24
- . get ( `http://localhost:4000 /actions` , {
24
+ . get ( `${ siteConfig . env . backendServiceURL } /actions` , {
25
25
params : {
26
26
coaching_session_id : coachingSessionId ,
27
27
} ,
28
28
withCredentials : true ,
29
29
setTimeout : 5000 , // 5 seconds before timing out trying to log in with the backend
30
30
headers : {
31
- "X-Version" : "0.0.1" ,
31
+ "X-Version" : siteConfig . env . backendApiVersion ,
32
32
} ,
33
33
} )
34
34
. then ( function ( response : AxiosResponse ) {
@@ -85,11 +85,11 @@ export const createAction = async (
85
85
var err : string = "" ;
86
86
87
87
const data = await axios
88
- . post ( `http://localhost:4000 /actions` , newActionJson , {
88
+ . post ( `${ siteConfig . env . backendServiceURL } /actions` , newActionJson , {
89
89
withCredentials : true ,
90
90
setTimeout : 5000 , // 5 seconds before timing out trying to log in with the backend
91
91
headers : {
92
- "X-Version" : "0.0.1" ,
92
+ "X-Version" : siteConfig . env . backendApiVersion ,
93
93
"Content-Type" : "application/json" ,
94
94
} ,
95
95
} )
@@ -141,11 +141,11 @@ export const updateAction = async (
141
141
console . debug ( "newActionJson: " + JSON . stringify ( newActionJson ) ) ;
142
142
143
143
const data = await axios
144
- . put ( `http://localhost:4000 /actions/${ id } ` , newActionJson , {
144
+ . put ( `${ siteConfig . env . backendServiceURL } /actions/${ id } ` , newActionJson , {
145
145
withCredentials : true ,
146
146
setTimeout : 5000 , // 5 seconds before timing out trying to log in with the backend
147
147
headers : {
148
- "X-Version" : "0.0.1" ,
148
+ "X-Version" : siteConfig . env . backendApiVersion ,
149
149
"Content-Type" : "application/json" ,
150
150
} ,
151
151
} )
@@ -183,11 +183,11 @@ export const deleteAction = async (id: Id): Promise<Action> => {
183
183
var err : string = "" ;
184
184
185
185
const data = await axios
186
- . delete ( `http://localhost:4000 /actions/${ id } ` , {
186
+ . delete ( `${ siteConfig . env . backendServiceURL } /actions/${ id } ` , {
187
187
withCredentials : true ,
188
188
setTimeout : 5000 , // 5 seconds before timing out trying to log in with the backend
189
189
headers : {
190
- "X-Version" : "0.0.1" ,
190
+ "X-Version" : siteConfig . env . backendApiVersion ,
191
191
"Content-Type" : "application/json" ,
192
192
} ,
193
193
} )
0 commit comments