axiosInstance replaced with apiCall

This commit is contained in:
Jan Prochazka
2021-12-22 10:16:44 +01:00
parent 148af24b2c
commit f9c54cdce2
55 changed files with 257 additions and 328 deletions

View File

@@ -21,6 +21,7 @@
import { extensions } from '../stores';
import _ from 'lodash';
import { getDatabaseFileLabel } from '../utility/getConnectionLabel';
import { apiCall } from '../utility/api';
export let connection;
@@ -38,11 +39,11 @@
isTesting = true;
testIdRef.update(x => x + 1);
const testid = testIdRef.get();
const resp = await axiosInstance().post('connections/test', e.detail);
const resp = await apiCall('connections/test', e.detail);
if (testIdRef.get() != testid) return;
isTesting = false;
sqlConnectResult = resp.data;
sqlConnectResult = resp;
}
function handleCancelTest() {
@@ -70,7 +71,7 @@
let connection = _.omit(e.detail, omitProps);
if (driver?.beforeConnectionSave) connection = driver?.beforeConnectionSave(connection);
axiosInstance().post('connections/save', connection);
apiCall('connections/save', connection);
closeCurrentModal();
}