samedi 7 février 2015

How should I go about removing models that have been soft deleted server side?

I am wondering if anyone has a good solution to unloading deleted records with ember data.


The backend is implemented using a logical delete. So the records are available with a flagged attribute deleted_at.


I am thinking the json api should serialize deleted records with only three fields id, deleted_at and deleted_by. Then the ember client when loading the payload into the store would remove previous loaded records when the deleted_at key is present.


Or


The json api should serialize the deleted records as meta data along with the normal payload. Then the ember client reads the meta data finds and unloads persisted records using it.


SO


Has anyone pulled this off? Where would be the proper place to implement this functionality?





Aucun commentaire:

Enregistrer un commentaire