}
+// 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');
upload_window.style.display='none';
}
- // FIXME tell the server to delete the files
+ // tell the server to delete the files
uploads.forEach(u => {
- console.log(u.ref);
+ flush_one_upload(u.ref);
});
uploads=[];