Lookup district and show on report submission complete

This commit is contained in:
Eli Ribble 2026-02-01 02:37:35 +00:00
parent d28e3e2ccc
commit c5f6db0b73
No known key found for this signature in database
5 changed files with 78 additions and 10 deletions

View file

@ -49,13 +49,18 @@ func getNuisance(w http.ResponseWriter, r *http.Request) {
)
}
func getSubmitComplete(w http.ResponseWriter, r *http.Request) {
report := r.URL.Query().Get("report")
report_id := r.URL.Query().Get("report")
district, err := report.DistrictForReport(r.Context(), report_id)
if err != nil {
respondError(w, fmt.Sprintf("Failed to get district for report '%s'", report_id, err), err, http.StatusInternalServerError)
return
}
html.RenderOrError(
w,
SubmitCompleteT,
ContentNuisanceSubmitComplete{
District: nil,
ReportID: report,
District: newContentDistrict(district),
ReportID: report_id,
URL: makeContentURL(),
},
)