Refactor the Controller
Learn and practice refactoring our controller to remove repeated blocks of code.
We'll cover the following
Refactor the recipes
controller
Currently, the get()
, update()
, and remove()
route handlers repeat the following chunk of logic to check that a recipe exists in the database and to throw an error if the recipe doesn’t exist:
Get hands-on with 1200+ tech skills courses.