June 2025
Intermediate to advanced
837 pages
24h 50m
English
Until now, the functionality of your application is limited to the display of data. In the next step, you provide your users with the option to delete data, as shown in Listing 6.20. To do this, you must first insert one link per record in the frontend. This link leads to a route on the server that takes care of deleting the record. After the deletion is done, you must redirect the user to the list so that the view gets updated.
<table> <thead><tr><th>Id</th><th>Title</th><th></th></tr></thead> <tbody> ${movies .map( movie => ` <tr> <td>${movie.id}</td> <td>${movie.title}</td> <td><a href="/movie/delete/${movie.id}">delete</a></td> </tr>`, ) .join('')} </tbody></table>
Listing 6.20 Extending ...
Read now
Unlock full access