Update the address when provided on a report

This commit is contained in:
Eli Ribble 2026-04-10 20:29:26 +00:00
parent bac55774f8
commit 12aedaf543
No known key found for this signature in database
6 changed files with 82 additions and 9 deletions

View file

@ -73,10 +73,6 @@ func (res *publicreportR) Update(ctx context.Context, r *http.Request, prf publi
return nil, nhttp.NewBadRequest("You must provide an ID")
}
report_setter := models.PublicreportReportSetter{}
if prf.Address != nil {
report_setter.AddressGid = omit.From(prf.Address.GID)
report_setter.AddressRaw = omit.From(prf.Address.Raw)
}
if prf.Location != nil {
//report_setter.Latitude = omit.From(prf.Location.Latitude)
//report_setter.Longitude = omit.From(prf.Location.Longitude)
@ -95,7 +91,7 @@ func (res *publicreportR) Update(ctx context.Context, r *http.Request, prf publi
report_setter.ReporterPhone = omit.From(*prf.Reporter.Phone)
}
}
report, err := platform.PublicReportUpdate(ctx, public_id, report_setter, prf.Location)
report, err := platform.PublicReportUpdate(ctx, public_id, report_setter, prf.Address, prf.Location)
if err != nil {
return nil, nhttp.NewError("update report: %w", err)
}