Remove report_location view, add lat lng to report table

This commit is contained in:
Eli Ribble 2026-03-18 18:55:50 +00:00
parent 341c3ef6b9
commit 21e8b9880d
No known key found for this signature in database
9 changed files with 57 additions and 358 deletions

View file

@ -44,8 +44,8 @@ func postRegisterNotifications(w http.ResponseWriter, r *http.Request) {
return
}
defer txn.Rollback(ctx)
location, err := models.PublicreportReportLocations.Query(
models.SelectWhere.PublicreportReportLocations.PublicID.EQ(report_id),
location, err := models.PublicreportReports.Query(
models.SelectWhere.PublicreportReports.PublicID.EQ(report_id),
).One(ctx, db.PGInstance.BobDB)
if err != nil {
log.Error().Err(err).Msg("Failed to get report location")
@ -53,7 +53,6 @@ func postRegisterNotifications(w http.ResponseWriter, r *http.Request) {
return
}
tablename := location.TableName.MustGet()
org_id := location.OrganizationID.MustGet()
e := report.SaveReporter(ctx, txn, report_id, name, email, phone, has_consent)
if e != nil {
@ -94,7 +93,7 @@ func postRegisterNotifications(w http.ResponseWriter, r *http.Request) {
}
}
txn.Commit(ctx)
platform.PublicReportReporterUpdated(ctx, org_id, report_id, tablename)
platform.PublicReportReporterUpdated(ctx, org_id, report_id)
http.Redirect(w, r, fmt.Sprintf("/register-notifications-complete?report=%s", report_id), http.StatusFound)
}