osmlab / to-fix-backend

The to-fix server
BSD 3-Clause "New" or "Revised" License
15 stars 13 forks source link

Move model validation logic to model files #238

Open batpad opened 6 years ago

batpad commented 6 years ago

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