I integrated the book editing and deletion by adding a new column for each and filling the cell with an icon. I then implemented dialogs for a user to confirm their action. I chose to do it this way so that a user can directly see the book that they are editing or deleting. I just thought that it made for a smoother user experience.
When implementing the edit/delete UI, I struggled mostly with getting the dialog to work. Since the dialog was a different component, I wanted to make a new file for it, but I found this to be difficult and not worth the time loss. I ended up adding it as a fragment in the table. I also had issues with creating a form.
It was pretty easy to refactor my existing UI to use Material UI. Since there are so many presets for common components, it was just a matter of replacing the tags. I've also had experience with Material UI in the past so I did not encounter any pitfalls.
It was really easy to add the editing endpoint and tests, after I had refactored my previous endpoints and tests. Since there was a standardized way to write endpoints and tests, it was simply copy and paste with small changes. Writing the POST endpoint did make it smoother as I was able to reuse most of it. The only differences between the two are that the inputs are no longer required, however an id is required.
Back