1
0
Fork 0
mirror of https://github.com/mealie-recipes/mealie.git synced 2025-07-23 15:19:41 +02:00

upload nextcloud data from UI

This commit is contained in:
Hayden 2021-01-09 18:55:26 -09:00
parent af87045037
commit 082448c6dc
4 changed files with 126 additions and 6 deletions

View file

@ -5,12 +5,12 @@ import { store } from "../store/store";
const migrationBase = baseURL + "migration/";
const migrationURLs = {
upload: migrationBase + "upload/",
delete: (file) => `${migrationBase}${file}/delete/`,
chowdownURL: migrationBase + "chowdown/repo/",
nextcloudAvaiable: migrationBase + "nextcloud/available/",
nextcloudImport: (selection) =>
`${migrationBase}nextcloud/${selection}/import/`,
nextcloudDelete: (selection) =>
`${migrationBase}nextcloud/${selection}/delete/`,
};
export default {
@ -28,4 +28,16 @@ export default {
let response = await apiReq.post(migrationURLs.nextcloudImport(selected));
return response.data;
},
async uploadFile(form_data) {
let response = await apiReq.post(migrationURLs.upload, form_data, {
headers: {
"Content-Type": "multipart/form-data",
},
});
return response.data;
},
async delete(file_folder_name) {
let response = await apiReq.delete(migrationURLs.delete(file_folder_name));
return response.data;
},
};