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

@@ -53,6 +53,7 @@
import openNewTab from '../utility/openNewTab';
import { getBoolSettingsValue } from '../settings/settingsTools';
import { setContext } from 'svelte';
import { apiCall } from '../utility/api';
export let tabid;
export let conid;
@@ -70,16 +71,8 @@
const [changeSetStore, dispatchChangeSet] = createUndoReducer(createChangeSet());
async function handleConfirmSql(sql) {
const resp = await axiosInstance().request({
url: 'database-connections/run-script',
method: 'post',
params: {
conid,
database,
},
data: { sql },
});
const { errorMessage } = resp.data || {};
const resp = await apiCall('database-connections/run-script', { conid, database, sql });
const { errorMessage } = resp || {};
if (errorMessage) {
showModal(ErrorMessageModal, { title: 'Error when saving', message: errorMessage });
} else {