jeudi 29 mai 2014

Question about reader's rootProperty and Parse.com's REST API

My backend is Parse.com's REST API, and parse send me back a results object that looks like:

{

...fields...

}


when there is only object, meaning any time there is a create, a read or an update to one record. When I GET a collection of objects from Parse, it sends out a results object that looks like:


{

results: [

{

...fields...

}

]

}


In ST, when I have my proxy's reader's rootProperty set to: 'results', my reader isn't able to read the record Parse sends on a create or an update and therefore the local record doesn't get synced with the one the server sent.


When I have my reader's rootProperty set to: '', my local record gets synced with the one that Parse sent, but now my list, which takes a store, isn't displaying the list of records, because Parse sends that with a "results" node.


I tried using setRootProperty, but despite confirming that the reader's root property just before calling save() on a record is in fact: '', the local record doesn't sync with Parse's response. As soon as I remove the logic that does real time changes to root property, it starts working again.


What is the suggested way of handling this situation? Any help is much appreciated! Thanks!





Aucun commentaire:

Enregistrer un commentaire