Fix address lat/lng location names, populate in report response

This commit is contained in:
Eli Ribble 2026-04-14 15:43:49 +00:00
parent 7e2a22c58c
commit 59e58840c9
No known key found for this signature in database
6 changed files with 129 additions and 113 deletions

View file

@ -70,8 +70,8 @@ func SignalCreateFromPublicreport(ctx context.Context, user User, report_id stri
return nil, fmt.Errorf("site from address: %w", err)
}
site_id = site.ID
lat := address.LocationY.GetOr(0.0)
lng := address.LocationX.GetOr(0.0)
lat := address.LocationLatitude.GetOr(0.0)
lng := address.LocationLongitude.GetOr(0.0)
location = fmt.Sprintf("POINT(%f %f)", lng, lat)
} else if report.LocationLatitude.IsValue() && report.LocationLongitude.IsValue() {
lat := report.LocationLatitude.MustGet()
@ -97,8 +97,8 @@ func SignalCreateFromPublicreport(ctx context.Context, user User, report_id stri
return nil, fmt.Errorf("find address from raw: %w", err)
}
site_id = site.ID
lat := address.LocationY.GetOr(0.0)
lng := address.LocationX.GetOr(0.0)
lat := address.LocationLatitude.GetOr(0.0)
lng := address.LocationLongitude.GetOr(0.0)
location = fmt.Sprintf("POINT(%f %f)", lng, lat)
} else {
// We have no structured address, no GPS, no unstructued address.