diff --git a/frontend/src/components/prompts/UploadFiles.vue b/frontend/src/components/prompts/UploadFiles.vue index d3a96bc5..88a0b607 100644 --- a/frontend/src/components/prompts/UploadFiles.vue +++ b/frontend/src/components/prompts/UploadFiles.vue @@ -74,7 +74,6 @@ export default { "getETA", ]), ...mapWritableState(useFileStore, ["reload"]), - ...mapActions(useUploadStore, ["reset"]), formattedETA() { if (!this.getETA || this.getETA === Infinity) { return "--:--:--"; @@ -92,6 +91,7 @@ export default { }, }, methods: { + ...mapActions(useUploadStore, ["reset"]), // Mapping reset action from upload store toggle: function () { this.open = !this.open; }, @@ -100,8 +100,8 @@ export default { abortAllUploads(); buttons.done("upload"); this.open = false; - this.reset(); - this.reload = true; + this.reset(); // Resetting the upload store state + this.reload = true; // Trigger reload in the file store } }, }, diff --git a/http/http.go b/http/http.go index f91ec426..620c43fd 100644 --- a/http/http.go +++ b/http/http.go @@ -69,6 +69,7 @@ func NewHandler( api.PathPrefix("/tus").Handler(monkey(tusPostHandler(), "/api/tus")).Methods("POST") api.PathPrefix("/tus").Handler(monkey(tusHeadHandler(), "/api/tus")).Methods("HEAD", "GET") api.PathPrefix("/tus").Handler(monkey(tusPatchHandler(), "/api/tus")).Methods("PATCH") + api.PathPrefix("/tus").Handler(monkey(resourceDeleteHandler(fileCache), "/api/tus")).Methods("DELETE") api.PathPrefix("/usage").Handler(monkey(diskUsage, "/api/usage")).Methods("GET") diff --git a/http/resource.go b/http/resource.go index 11fa2930..f03f17fb 100644 --- a/http/resource.go +++ b/http/resource.go @@ -87,7 +87,7 @@ func resourceDeleteHandler(fileCache FileCache) handleFunc { return errToStatus(err), err } - return http.StatusOK, nil + return http.StatusNoContent, nil }) }