Reputation: 527
What would be the best approach to handle Model State Errors for the the basket to the user that loads the basket from the API ?
Scenario:
Should the client make two requests:
Another way of doing it might be extending the response view model with 'errors' that might get populated whenever user GET it via API. Not sure though if this is good practice though.
What would be the RESTful way of solving this problem ?
Thanks in advance for help
Upvotes: 0
Views: 94
Reputation: 57204
What would be the RESTful way of solving this problem ?
How would you do it with a web page?
It would probably be a single web page, right? Containing
Another way of doing it might be extending the response view model with 'errors' that might get populated whenever user GET it via API. Not sure though if this is good practice though.
It's fine - the resource model is not the domain model is not the data model. Your "resources" are documents that support interacting with the domain.
See also: Webber 2011.
Upvotes: 1