From 52a0031d1678060809557057b5a2bacf07999b07 Mon Sep 17 00:00:00 2001 From: Eli Ribble Date: Tue, 13 Jan 2026 19:52:25 +0000 Subject: [PATCH] Handle shifting location column for nuisance table I shifted it so the three report tables have a common schema when creating the report_location view. --- public-report/nuisance.go | 12 +++++++----- public-report/template/nuisance.html | 4 ++-- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/public-report/nuisance.go b/public-report/nuisance.go index b09fb916..a2eae7c4 100644 --- a/public-report/nuisance.go +++ b/public-report/nuisance.go @@ -11,6 +11,7 @@ import ( "github.com/Gleipnir-Technology/nidus-sync/db/models" "github.com/Gleipnir-Technology/nidus-sync/htmlpage" "github.com/aarondl/opt/omit" + "github.com/aarondl/opt/omitnull" "github.com/rs/zerolog/log" ) @@ -74,11 +75,11 @@ func postNuisance(w http.ResponseWriter, r *http.Request) { return } - location_str := postFormValueOrNone(r, "location") - var location enums.PublicreportNuisancelocationtype - err = location.Scan(location_str) + source_location_str := postFormValueOrNone(r, "source-location") + var source_location enums.PublicreportNuisancelocationtype + err = source_location.Scan(source_location_str) if err != nil { - respondError(w, fmt.Sprintf("Failed to interpret 'location' of '%s'", location_str), err, http.StatusBadRequest) + respondError(w, fmt.Sprintf("Failed to interpret 'source-location' of '%s'", source_location_str), err, http.StatusBadRequest) return } preferred_date_range_str := postFormValueOrNone(r, "preferred-date-range") @@ -123,7 +124,7 @@ func postNuisance(w http.ResponseWriter, r *http.Request) { Duration: omit.From(duration), Email: omit.From(email), InspectionType: omit.From(inspection_type), - Location: omit.From(location), + Location: omitnull.FromPtr[string](nil), PreferredDateRange: omit.From(preferred_date_range), PreferredTime: omit.From(preferred_time), PublicID: omit.From(public_id), @@ -132,6 +133,7 @@ func postNuisance(w http.ResponseWriter, r *http.Request) { SourceContainer: omit.From(source_container), SourceDescription: omit.From(source_description), SourceRoof: omit.From(source_roof), + SourceLocation: omit.From(source_location), SourceStagnant: omit.From(source_stagnant), TimeOfDayDay: omit.From(tod_day), TimeOfDayEarly: omit.From(tod_early), diff --git a/public-report/template/nuisance.html b/public-report/template/nuisance.html index 84f34b6f..ccc5ee93 100644 --- a/public-report/template/nuisance.html +++ b/public-report/template/nuisance.html @@ -255,8 +255,8 @@ document.addEventListener('DOMContentLoaded', function() {
- -