Show full district details on location search
This commit is contained in:
parent
f6b5a1e580
commit
9b5140f0c2
3 changed files with 71 additions and 9 deletions
|
|
@ -103,8 +103,15 @@ func apiGetDistrict(w http.ResponseWriter, r *http.Request) {
|
|||
render.Render(w, r, errRender(fmt.Errorf("Failed to get district: %w", err)))
|
||||
return
|
||||
}
|
||||
if district == nil {
|
||||
http.NotFound(w, r)
|
||||
return
|
||||
}
|
||||
d := ResponseDistrict{
|
||||
Agency: district.Agency.GetOr(""),
|
||||
Agency: district.Agency.GetOr(""),
|
||||
Manager: district.GeneralMG.GetOr(""),
|
||||
Phone: district.Phone1.GetOr(""),
|
||||
Website: district.Website.GetOr(""),
|
||||
}
|
||||
if err := render.Render(w, r, d); err != nil {
|
||||
render.Render(w, r, errRender(err))
|
||||
|
|
|
|||
|
|
@ -63,7 +63,10 @@ type NoteAudioPayload struct {
|
|||
}
|
||||
|
||||
type ResponseDistrict struct {
|
||||
Agency string `json:"agency"`
|
||||
Agency string `json:"agency"`
|
||||
Manager string `json:"manager"`
|
||||
Phone string `json:"phone"`
|
||||
Website string `json:"website"`
|
||||
}
|
||||
|
||||
type ResponseMosquitoSource struct {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue