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

@@ -74,6 +74,7 @@
import { showModal } from '../modals/modalTools';
import { currentDatabase } from '../stores';
import { apiCall } from '../utility/api';
import axiosInstance from '../utility/axiosInstance';
import getConnectionLabel from '../utility/getConnectionLabel';
@@ -114,7 +115,7 @@
showModal(ConfirmModal, {
message: `Really delete file ${data.file}?`,
onConfirm: () => {
axiosInstance().post('files/delete', data);
apiCall('files/delete', data);
},
});
};
@@ -125,7 +126,7 @@
label: 'New file name',
header: 'Rename file',
onConfirm: newFile => {
axiosInstance().post('files/rename', { ...data, newFile });
apiCall('files/rename', { ...data, newFile });
},
});
};
@@ -136,13 +137,13 @@
label: 'New file name',
header: 'Rename file',
onConfirm: newFile => {
axiosInstance().post('files/copy', { ...data, newFile });
apiCall('files/copy', { ...data, newFile });
},
});
};
async function openTab() {
const resp = await axiosInstance().post('files/load', { folder, file: data.file, format: handler.format });
const resp = await apiCall('files/load', { folder, file: data.file, format: handler.format });
const connProps: any = {};
let tooltip = undefined;
@@ -168,7 +169,7 @@
...connProps,
},
},
{ editor: resp.data }
{ editor: resp }
);
}
</script>