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

@@ -3,6 +3,7 @@ import getElectron from './getElectron';
import { currentArchive, extensions, selectedWidget } from '../stores';
import axiosInstance from '../utility/axiosInstance';
import { showSnackbarSuccess } from './snackbar';
import { apiCall } from './api';
export async function openArchiveFolder() {
const electron = getElectron();
@@ -12,9 +13,9 @@ export async function openArchiveFolder() {
});
const linkedFolder = filePaths && filePaths[0];
if (!linkedFolder) return;
const resp = await axiosInstance().post('archive/create-link', { linkedFolder });
const resp = await apiCall('archive/create-link', { linkedFolder });
currentArchive.set(resp.data);
currentArchive.set(resp);
selectedWidget.set('archive');
showSnackbarSuccess(`Created link ${resp.data}`);
showSnackbarSuccess(`Created link ${resp}`);
}