Set status when creating reports

Because we added this as a non-null required field a migration or two
ago.
This commit is contained in:
Eli Ribble 2026-01-14 18:59:25 +00:00
parent 6fd0ed8711
commit ea48364d95
No known key found for this signature in database
3 changed files with 5 additions and 0 deletions

View file

@ -135,6 +135,7 @@ func postNuisance(w http.ResponseWriter, r *http.Request) {
SourceRoof: omit.From(source_roof),
SourceLocation: omit.From(source_location),
SourceStagnant: omit.From(source_stagnant),
Status: omit.From(enums.PublicreportReportstatustypeReported),
TimeOfDayDay: omit.From(tod_day),
TimeOfDayEarly: omit.From(tod_early),
TimeOfDayEvening: omit.From(tod_evening),

View file

@ -8,6 +8,7 @@ import (
"github.com/Gleipnir-Technology/nidus-sync/config"
"github.com/Gleipnir-Technology/nidus-sync/db"
"github.com/Gleipnir-Technology/nidus-sync/db/enums"
"github.com/Gleipnir-Technology/nidus-sync/db/models"
"github.com/Gleipnir-Technology/nidus-sync/htmlpage"
"github.com/aarondl/opt/omit"
@ -117,6 +118,7 @@ func postPool(w http.ResponseWriter, r *http.Request) {
ReporterEmail: omit.From(reporter_email),
ReporterName: omit.From(reporter_name),
ReporterPhone: omit.From(reporter_phone),
Status: omit.From(enums.PublicreportReportstatustypeReported),
Subscribe: omit.From(subscribe),
}
pool, err := models.PublicreportPools.Insert(&setter).One(r.Context(), db.PGInstance.BobDB)

View file

@ -7,6 +7,7 @@ import (
"time"
"github.com/Gleipnir-Technology/nidus-sync/db"
"github.com/Gleipnir-Technology/nidus-sync/db/enums"
"github.com/Gleipnir-Technology/nidus-sync/db/models"
"github.com/Gleipnir-Technology/nidus-sync/h3utils"
"github.com/Gleipnir-Technology/nidus-sync/htmlpage"
@ -79,6 +80,7 @@ func postQuick(w http.ResponseWriter, r *http.Request) {
PublicID: omit.From(u),
ReporterEmail: omit.From(""),
ReporterPhone: omit.From(""),
Status: omit.From(enums.PublicreportReportstatustypeReported),
}
quick, err := models.PublicreportQuicks.Insert(&setter).One(r.Context(), db.PGInstance.BobDB)
if err != nil {