Fix #4987: Can't populate tag string from upload url anymore.
Usage: https://danbooru.donmai.us/uploads/new?url=...&post[tag_string]=...&post[rating]=... * Pass the URL parameters from the /uploads/new page to the /uploads/:id page. * Fix the /uploads/:id page throwing an "unpermitted parameters" error when given URL params for the post edit form.
This commit is contained in:
@@ -102,7 +102,14 @@ export default class FileUploadComponent {
|
||||
}
|
||||
|
||||
if (upload.status === "completed") {
|
||||
window.location.replace(`/uploads/${upload.id}`);
|
||||
let params = new URLSearchParams(window.location.search);
|
||||
params.delete("url");
|
||||
params.delete("ref");
|
||||
|
||||
let url = new URL(`/uploads/${upload.id}`, window.location.origin);
|
||||
url.search = params.toString();
|
||||
|
||||
window.location.replace(url);
|
||||
} else {
|
||||
this.$dropzone.removeClass("success");
|
||||
this.$component.find("progress").addClass("hidden");
|
||||
|
||||
Reference in New Issue
Block a user