debut logique pour post sur la route

This commit is contained in:
2024-12-04 14:05:11 +01:00
parent 5a6990faa1
commit b78154c582
5 changed files with 86 additions and 12 deletions

View File

@ -166,7 +166,20 @@ export default {
methods: {
async loadZipContent() {
try {
const response = await fetch(this.zipUrl);
var baseUrl = OC.generateUrl('/apps/webtransfer/getZipFile');
var postData = {
subUrl: this.zipUrl
};
let response = await fetch(baseUrl, {
method: 'POST',
headers: {
'Content-Type': 'application/json' // Type de contenu JSON
},
body: JSON.stringify(postData) // Convertir les données en JSON
})
console.log('response: ', await response.json())
const zipData = await response.blob();
this.zipName = this.zipUrl.split('/').pop();
const zip = await JSZip.loadAsync(zipData);