Creating tickets and using triggers
In this section, you’ll implement and extend the existing form for ticket creation and learn which RLS policies you need. If you sign in and go to https://packt.local:3000/tickets/new
, it will show the following UI, which we created in Chapter 3:
Figure 8.8: The current ticket creation form
It looks like we are missing fields, as our table contains more than just two columns, but in fact, we’re not missing anything. The other column values are implicitly given. The author (created_by
) is the one who submits the ticket, the created_at
date is automatically filled at ticket creation, and the status
value is set to open
by default. So, the only two custom fields, right now, are title
and description
.
This form will get more fields when we are extending its features but first, we want to allow the creation of a ticket with the existing two fields and show the respective ticket details on the Ticket Details...