diff --git a/frontend/api/bbgo.ts b/frontend/api/bbgo.ts index 5423cd04a..195437f3b 100644 --- a/frontend/api/bbgo.ts +++ b/frontend/api/bbgo.ts @@ -15,18 +15,19 @@ export function queryOutboundIP(cb) { }); } -const triggerSync = async () => { +export async function triggerSync() { return axios.post(baseURL + '/api/environment/sync'); }; -export { triggerSync }; +export enum SyncStatus { + SyncNotStarted = 0, + Syncing = 1, + SyncDone = 2 +} -export function querySyncStatus(cb) { - return axios - .get(baseURL + '/api/environment/syncing') - .then((response) => { - cb(response.data.syncing); - }); +export async function querySyncStatus(): Promise { + const resp = await axios.get(baseURL + '/api/environment/syncing') + return resp.data.syncing } export function testDatabaseConnection(params, cb) {