Adding Validation to Book
Now that we've added validation to the Reader
model, our next task is to add validation to Book
.
In this case we just want to make sure that we have an author and a title.
- Make sure constraints and validation are added to the
Book
model. - Make sure the controller knows how to handle the different error messages the model might throw.
- Write unit tests that make sure that this functionality is in place.