Fix signals getting saved with correct location
This commit is contained in:
parent
e86cdc6764
commit
c4359a3c81
2 changed files with 8 additions and 3 deletions
|
|
@ -68,7 +68,7 @@ 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.LocationX.GetOr(0.0)
|
||||
lat := address.LocationY.GetOr(0.0)
|
||||
lng := address.LocationX.GetOr(0.0)
|
||||
location = fmt.Sprintf("POINT(%f %f)", lng, lat)
|
||||
} else if report.LocationLatitude.IsValue() && report.LocationLongitude.IsValue() {
|
||||
|
|
@ -95,7 +95,7 @@ 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.LocationX.GetOr(0.0)
|
||||
lat := address.LocationY.GetOr(0.0)
|
||||
lng := address.LocationX.GetOr(0.0)
|
||||
location = fmt.Sprintf("POINT(%f %f)", lng, lat)
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue