mercredi 29 mars 2017

Ember: Does Ember Data handle delayed record creation

I am building an Ember app against an api that has an endpoint for creating a resource via a queue.

When I send the POST to the endpoint it will respond with a 202 Accepted if the parameters are okay, then add the actual work to create the record to a queue. No id is returned because the backend doesn't have one yet.

I'm just wondering if there is a means of using the Ember Data store to save records for this case. I can see how not returning an id would be problematic, but since 202 Accepted has semantic meaning in JSONApi, I was curious whether Ember Data handles this somehow.

Right now I am simply calling the adapter's createRecord function directly instead of using the store.




Aucun commentaire:

Enregistrer un commentaire