fix: Improve form submission redirection logic for iOS and update navigation link formatting

This commit is contained in:
2026-05-10 18:29:16 +02:00
parent 8a312b6a4e
commit 711f4d4652
2 changed files with 7 additions and 4 deletions
+6 -3
View File
@@ -156,11 +156,14 @@ function fixIOSFormSubmission() {
// Show success and redirect
alert(data.message || 'Element erfolgreich hinzugefügt');
// Redirect to the appropriate page
// Redirect back to the configured target or the current page
const redirectTarget = form.dataset.successRedirect || form.dataset.redirectUrl || window.location.pathname;
if (data.itemId) {
window.location.href = `/home_admin?highlight_item=${data.itemId}`;
const redirectUrl = new URL(redirectTarget, window.location.origin);
redirectUrl.searchParams.set('highlight_item', data.itemId);
window.location.href = redirectUrl.toString();
} else {
window.location.href = '/home_admin';
window.location.href = redirectTarget;
}
} else {
// Show error