Skip to content

Commit

Permalink
Merge pull request #13 from Cadasta/delete-fixes
Browse files Browse the repository at this point in the history
Delete fixes
  • Loading branch information
oliverroick authored Oct 5, 2016
2 parents 8e64da1 + 8dfe86a commit 9aa9ea1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion buckets/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '0.1.17'
__version__ = '0.1.18'
12 changes: 8 additions & 4 deletions buckets/static/buckets/js/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,11 +156,15 @@
e.preventDefault();

var el = e.target.parentElement.parentElement;
var url = el.getAttribute('data-upload-to') + '/' + el.querySelector('.file-link').innerHTML,
headers = { // 'content-type': 'application/json',
'X-CSRFToken': getCookie('csrftoken')},
var urlArray = el.querySelector('.file-url').value.split('/'),
headers = { 'X-CSRFToken': getCookie('csrftoken')},
form = new FormData();
form.append('key', url);

var url = urlArray[urlArray.length - 1];
if (el.getAttribute('data-upload-to').length) {
url = el.getAttribute('data-upload-to') + '/' + url;
}
form.append('key', url);

request('POST', '/s3/delete-resource/', form, headers, null, function() {
el.querySelector('.file-url').value = '';
Expand Down

0 comments on commit 9aa9ea1

Please sign in to comment.