KostyaTretyak/ng-stack

[api-mock] Dont make changes if put/post/etc returns a HttpErrorResponse

yusijs opened this issue · 5 comments

I'm currently using api-mock for a project, and I've found a lot of stuff I absolutely love about it. However, I recently implemented a PUT operation where I want it to throw errors in certain scenarioes. I implemented a handler for it, and I am able to return an error.

Despite returning an error, the items in my collections gets updated. Any chance this behaviour can be changed, or we can somehow control the updates ourselves with a config flag?

Thanks!

Do you use responseCallback in this case?

I do, yes.

That is, your Angular component gets an error, but @ng-stack/api-mock still updates the mock data?

Yes - the 400 errors gets returned as expected, but the item still gets changed.

Sorry, but @ng-stack/api-mock no more supports.