Fix catalog redirects pointing at the old /ruoat

Adding, editing or deleting a dish redirected to /ruoat, which stopped
existing when the tab was renamed to Ruuat. Every one of those actions ended
on a 404. Shipped in v20260905-4.

The rename was done with a scripted replace across views.templ, main.go and
the smoke script; handlers.go was not in the list.

The tests did not catch it because they asserted only that the response was a
303. A redirect to a dead URL is still a 303. They now assert the target.
This commit is contained in:
Esa Kataja
2026-09-05 23:35:45 +03:00
parent 174652778b
commit f8b908b39e
2 changed files with 17 additions and 12 deletions
+3 -3
View File
@@ -508,7 +508,7 @@ func (a *app) saveMain(w http.ResponseWriter, r *http.Request) {
log.Printf("save main: %v", err)
form.Err = "Tallennus epäonnistui."
default:
http.Redirect(w, r, "/ruoat", http.StatusSeeOther)
http.Redirect(w, r, "/ruuat", http.StatusSeeOther)
return
}
}
@@ -537,7 +537,7 @@ func (a *app) saveSide(w http.ResponseWriter, r *http.Request) {
log.Printf("save side: %v", err)
form.Err = "Tallennus epäonnistui."
default:
http.Redirect(w, r, "/ruoat", http.StatusSeeOther)
http.Redirect(w, r, "/ruuat", http.StatusSeeOther)
return
}
}
@@ -565,7 +565,7 @@ func (a *app) deleteDish(w http.ResponseWriter, r *http.Request) {
http.Error(w, "poisto epäonnistui", http.StatusInternalServerError)
return
}
http.Redirect(w, r, "/ruoat", http.StatusSeeOther)
http.Redirect(w, r, "/ruuat", http.StatusSeeOther)
}
// importDishes takes a bundle either pasted into the textarea or uploaded as a