Actually commit changes to notifications

This commit is contained in:
Eli Ribble 2026-02-10 05:28:23 +00:00
parent e40fe55eaf
commit 1b85ce0d78
No known key found for this signature in database

View file

@ -40,6 +40,7 @@ func postRegisterNotifications(w http.ResponseWriter, r *http.Request) {
http.Redirect(w, r, fmt.Sprintf("/error?code=transaction-failed&report=%s", report_id), http.StatusFound)
return
}
defer txn.Rollback(ctx)
e := report.SaveReporter(ctx, txn, report_id, name, email, phone, has_consent)
if e != nil {
log.Error().Err(e).Str("name", name).Msg("Failed to save reporter")
@ -78,5 +79,6 @@ func postRegisterNotifications(w http.ResponseWriter, r *http.Request) {
}
}
}
txn.Commit(ctx)
http.Redirect(w, r, fmt.Sprintf("/register-notifications-complete?report=%s", report_id), http.StatusFound)
}