This is kind of a wild one. Turns out that the triggers I was using
actually fire before the transaction is closed and I was primarily
getting lucky that the job was present on the other side of the
connection rather than having things built correctly.
I've fixed this by removing the trigger entirely and instead manually
triggering as part of the transaction. This makes the NOTIFY call happen
as soon as the transaction closes, just at the cost of making my
application be in charge of ensuring the NOTIFY gets called. Seems like
a win.
Part of doing this is porting the existing job creation code over to use
Jet. It's something I want to do anyway, so it's a win all around.
- Add ErrorNotification component above the contact form
- Replace console.error with user-visible error messages in
handleSubmit for both HTTP error responses and exceptions
- Add isSubmitting ref with :disabled binding to prevent
double-submission (consistent with Nuisance/Water forms)
- Clear errorMessage on each submission attempt
Issue: #8
ContactSimple is the replacement for ContactReporter, which was the
simplified form of a contact from a report. I made the name more generic
and use it in the general report structures for consistency.
- Add ts/rmo/components/ErrorNotification.vue — reusable error alert
with dismiss support, accessible markup, and configurable message
- Replace inline error div in Nuisance.vue with ErrorNotification
- Add resp.ok check in doSubmit() so HTTP error responses are caught
and the workflow stops instead of proceeding to /submitted
- Fix typo: borwser → browser
Issue: #8
This was causing a request to be made to the wrong API endpoint by going
to /api/publicreport instead of /api/rm/publicreport which doesn't work
on RMO's hostname.
This is useful because everywhere that we use the AddressAndMapLocator
component we also want to use the user's location and we want to zoom
the map based on their location. Instead of tracking this externally in
3 places we just pull it into the component.
The idea here is that we'll make compliance reports two different ways,
The first is if the user navigates to /district/:slug/compliance, the
second if they open a QR code from a mailer. In both cases we create the
report then feed them into a flow for updating the data on that report.