Most of this was already in place. We now just run through our upload
list and do an async DELETE operation for each one.
+// Helper function for flush_uploads()
+flush_one_upload = async(ref) => {
+ response = await fetch(
+ "/ctdl/p/" + ref, { method: "DELETE" }
+ );
+ // We don't have any interest in the server response.
+}
+
+
// Flush all uploaded files and close the window
function flush_uploads() {
upload_window = document.getElementById('ctdl-upload');
// Flush all uploaded files and close the window
function flush_uploads() {
upload_window = document.getElementById('ctdl-upload');
upload_window.style.display='none';
}
upload_window.style.display='none';
}
- // FIXME tell the server to delete the files
+ // tell the server to delete the files
+ flush_one_upload(u.ref);