Right now we are doing a lot of model validation in the routes prior to handing off data to the model to save in the database.
This results in duplicating a lot of core model validation logic in multiple views (create-item and update-item for eg.) - all this validation logic should be moved to the model, and the route should only be responsible for handing data to the model, and surfacing back any validation errors back to the user.
Right now we are doing a lot of model validation in the
routes
prior to handing off data to the model to save in the database.This results in duplicating a lot of core model validation logic in multiple views (create-item and update-item for eg.) - all this validation logic should be moved to the model, and the route should only be responsible for handing data to the model, and surfacing back any validation errors back to the user.
cc @kepta