CrshOverride / ember-web-api

Ember Data Addon for .NET Web API Endpoints
MIT License
20 stars 12 forks source link

Refactor Server-Side Validation Error Handling #6

Closed CrshOverride closed 9 years ago

CrshOverride commented 9 years ago

The current implementation of isValid has a bit of a nasty side-effect in that it formats the payload at the same time. Calling isValid should only do the necessary calculation. There is also some necessary logic that lingers in the serializer as well.

This refactor moves all of the munging logic for errors into a single location and performs the transformation as soon as the response comes back from the server. isValid now only performs the simple calculation to return the response as expected.