feat: upload file

This commit is contained in:
cv
2021-06-06 22:25:23 +02:00
parent d4ee386cde
commit 560ae5be74
6 changed files with 107 additions and 19 deletions
+4 -1
View File
@@ -28,7 +28,6 @@ export const downloadEvents = async () => {
};
export const uploadEvents = async (file) => {
console.log('uploading', file);
const formData = new FormData();
formData.append('jsondb', file); // appending file
await axios
@@ -40,3 +39,7 @@ export const uploadEvents = async (file) => {
.then((res) => console.log(res.data))
.catch((err) => console.error(err));
};
export const uploadEventsWithPath = async (filepath) => {
await axios.post(ontimeURL + '/dbpath', { path: filepath });
};