mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-18 12:35:59 +00:00
axiosInstance replaced with apiCall
This commit is contained in:
@@ -47,13 +47,11 @@
|
||||
header: 'Create collection',
|
||||
onConfirm: async newCollection => {
|
||||
const dbid = { conid: connection._id, database: name };
|
||||
await axiosInstance().request({
|
||||
url: 'database-connections/run-script',
|
||||
method: 'post',
|
||||
params: dbid,
|
||||
data: { sql: `db.createCollection('${newCollection}')` },
|
||||
await apiCall('database-connections/run-script', {
|
||||
...dbid,
|
||||
sql: `db.createCollection('${newCollection}')`,
|
||||
});
|
||||
axiosInstance().post('database-connections/sync-model', dbid);
|
||||
await apiCall('database-connections/sync-model', dbid);
|
||||
},
|
||||
});
|
||||
};
|
||||
@@ -90,19 +88,19 @@
|
||||
const handleDisconnect = () => {
|
||||
const electron = getElectron();
|
||||
if (electron) {
|
||||
axiosInstance().post('database-connections/disconnect', { conid: connection._id, database: name });
|
||||
apiCall('database-connections/disconnect', { conid: connection._id, database: name });
|
||||
}
|
||||
currentDatabase.set(null);
|
||||
};
|
||||
|
||||
const handleExportModel = async () => {
|
||||
const resp = await axiosInstance().post('database-connections/export-model', {
|
||||
const resp = await apiCall('database-connections/export-model', {
|
||||
conid: connection._id,
|
||||
database: name,
|
||||
});
|
||||
currentArchive.set(resp.data.archiveFolder);
|
||||
currentArchive.set(resp.archiveFolder);
|
||||
selectedWidget.set('archive');
|
||||
showSnackbarSuccess(`Saved to archive ${resp.data.archiveFolder}`);
|
||||
showSnackbarSuccess(`Saved to archive ${resp.archiveFolder}`);
|
||||
};
|
||||
|
||||
const handleCompareWithCurrentDb = () => {
|
||||
@@ -182,6 +180,7 @@
|
||||
import InputTextModal from '../modals/InputTextModal.svelte';
|
||||
import { getDatabaseInfo } from '../utility/metadataLoaders';
|
||||
import { openJsonDocument } from '../tabs/JsonTab.svelte';
|
||||
import { apiCall } from '../utility/api';
|
||||
|
||||
export let data;
|
||||
export let passProps;
|
||||
|
||||
Reference in New Issue
Block a user