Listing and filtering tickets
Now we want to make sure that we list all tickets of a tenant when signed in, showing the open ones at the top, ordered by date. Not just that; we also want to allow users to filter tickets by title.
However, first, let’s make sure that the current mocked ticket list is replaced with real data. To do this, make sure to create at least 15 tickets with two different user accounts so that we actually can filter different tickets and see that our list works. Once done, you’re ready to continue.
Remember
If you’re on http://packt.local:3000/register, you can enter just any email ending with @packt.local and then confirm it with the link sent to your Inbucket inbox.
To implement the ticket list loading, open [tenant]/tickets/page.js in your editor and remove the code that passes tickets to the TicketList component (<TicketList tickets=… />). Instead, we want the TicketList component to be responsible for data fetching...