Lookup district and show on report submission complete
This commit is contained in:
parent
d28e3e2ccc
commit
c5f6db0b73
5 changed files with 78 additions and 10 deletions
|
|
@ -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(),
|
||||
},
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue