diff options
Diffstat (limited to 'public/assets/js/lib/views/details/settings.js')
| -rw-r--r-- | public/assets/js/lib/views/details/settings.js | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/public/assets/js/lib/views/details/settings.js b/public/assets/js/lib/views/details/settings.js index a027b12..b270f02 100644 --- a/public/assets/js/lib/views/details/settings.js +++ b/public/assets/js/lib/views/details/settings.js @@ -316,32 +316,32 @@ var ThreadSettingsForm = FormView.extend({ file_names.join("\n") var should_remove = confirm(msg) if (should_remove) { - } - var promises = inputs_checked.map(node => { - return new Promise((resolve, reject) => { - $.ajax({ - method: "DELETE", - url: "/api/file/" + node.value, - headers: { "csrf-token": $("[name=_csrf]").attr("value") }, - data: JSON.stringify({ csrf: csrf() }), - dataType: "json", - success: function(data){ - console.log(data) - $(node).closest('.file').remove() - }, - error: function(){ - console.log('error deleting file', node.value) - reject() - } + var promises = inputs_checked.map(node => { + return new Promise((resolve, reject) => { + $.ajax({ + method: "DELETE", + url: "/api/file/" + node.value, + headers: { "csrf-token": $("[name=_csrf]").attr("value") }, + data: JSON.stringify({ csrf: csrf() }), + dataType: "json", + success: function(data){ + console.log(data) + $(node).closest('.file').remove() + }, + error: function(){ + console.log('error deleting file', node.value) + reject() + } + }) }) }) - }) - Promise.all(promises).then( () => { - window.location.href = '/details/' + thread_id - }).catch(() =>{ - console.error('whaaaaa') - alert('there was a problem deleting the files...') - }) + Promise.all(promises).then( () => { + window.location.href = '/details/' + thread_id + }).catch(() =>{ + console.error('whaaaaa') + alert('there was a problem deleting the files...') + }) + } }, deleteThread: function(e){ |
