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

@@ -32,6 +32,7 @@
import ErrorInfo from '../elements/ErrorInfo.svelte';
import LoadingInfo from '../elements/LoadingInfo.svelte';
import { getObjectTypeFieldLabel } from '../utility/common';
import { apiCall } from '../utility/api';
export let conid;
export let database;
@@ -86,7 +87,7 @@
const loadid = uuidv1();
loadRef.set(loadid);
busy = true;
const response = await axiosInstance().post('database-connections/sql-preview', {
const response = await apiCall('database-connections/sql-preview', {
conid,
database,
objects,
@@ -96,7 +97,7 @@
// newer load exists
return;
}
const { sql, isTruncated, isError, errorMessage } = response.data || {};
const { sql, isTruncated, isError, errorMessage } = response || {};
truncated = isTruncated;
if (isError) {