Browse Source

Changed delete to use url parameters instead of json

pull/170/head
Michael Olund 5 years ago
parent
commit
613f7791b2
1 changed files with 5 additions and 3 deletions
  1. +5
    -3
      vue/src/components/Uploader/Uploader.vue

+ 5
- 3
vue/src/components/Uploader/Uploader.vue View File

@ -255,12 +255,14 @@ export default {
} }
}, },
remove(file) { remove(file) {
var url = this.$parent.proxyRootPath + "api/delete-document/";
axios.delete(url, {doc_type: this.docType, party_code: this.party, filename: file.name, size: file.size})
const urlbase = `${this.$parent.proxyRootPath}api/documents`;
const encFilename = encodeURIComponent(file.name);
const url = `${urlbase}/${this.docType}/${this.party}/${file.size}/${encFilename}`;
axios.delete(url)
.then(response => { .then(response => {
this.$refs.upload.remove(file) this.$refs.upload.remove(file)
}) })
.catch(error => {
.catch((error) => {
this.showError('Error deleting document from the server: ' + file.name); this.showError('Error deleting document from the server: ' + file.name);
}); });
}, },


Loading…
Cancel
Save