all the latest socket work
This commit is contained in:
1 parent
a530e5e6e0
commit
bc773154c6
18 files changed
+117
-61
No files matched your search
@@ -5,13 +5,18 @@ import { useAPIService } from './core';
|
||||
import { useMockAPI } from "./mock";
|
||||
|
||||
const locationPrefixWeb = window.location.pathname.match(/(.+)\/web/i);
|
||||
const baseURL = process.env.NODE_ENV === 'development' ?
|
||||
"http://localhost:8000" :
|
||||
(!locationPrefixWeb ? '' : locationPrefixWeb[1]);
|
||||
|
||||
export const remoteDetailsAPI = makeRemoteAPI(
|
||||
baseURL + "/details"
|
||||
);
|
||||
export const remoteAutoAPI = makeRemoteAPI(
|
||||
baseURL + "/automations"
|
||||
);
|
||||
export const useConnectedApiService = () => useAPIService(
|
||||
makeAutomationAPI(makeRemoteAPI(
|
||||
process.env.NODE_ENV === 'development' ?
|
||||
"http://localhost:8000/automations" :
|
||||
(!locationPrefixWeb ? '' : locationPrefixWeb[1]) + "/automations"
|
||||
))
|
||||
makeAutomationAPI(remoteAutoAPI)
|
||||
);
|
||||
export const useMockApiService = (initialAutos: AutomationData[]) => useAPIService(
|
||||
makeAutomationAPI(useMockAPI(initialAutos))
|
||||
|
||||
Reference in new issue
Block a user