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:
parent
6fd0ed8711
commit
ea48364d95
3 changed files with 5 additions and 0 deletions
|
|
@ -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),
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue