canjs / can-connect

Model layer utilities for every JavaScript framework! Assemble real-time, high performance, restful data connections.
https://canjs.com/doc/can-connect.html
MIT License
29 stars 16 forks source link

Fix destroy when server returns non-identifying object or 204 No Content #373

Closed BigAB closed 6 years ago

BigAB commented 6 years ago

Fixes #365

This fix temporarily adds instances to the instanceStore while they are being delete, so that list with bound length will still have the proper instances removed when destroying an instance while using the real-time behaviour.

This particular fix will solve the problem for when the server/fixtures respond with an empty object or some JSON that does not identify (with an id for example) the instance BUT this will also fix the case for 204 No Content (a common delete response on some restful services), as soon as this issue is fixed in can-ajax