Items can be deleted from the database by sending the DELETE method request to the http://localhost:8080/api/cars/[carid] endpoint. If we look at the JSON response data, we can see that each car contains a link to itself and that it can be accessed from the _links.self.href node, as shown in the following screenshot:
The following steps demonstrate how to implement the delete functionality:
- Here, we will create a button for each row in the table. The accessor of the button will be _links.self.href, which we can use to call the delete function that we will create soon. But first, add a new column to the table using Cell to render the button. Refer to the following source code. We don't want to enable sorting and filtering for the button column. Therefore, these props are set to false. The button invokes the onDelClick function when pressed and sends...