Closed theninthnode closed 10 years ago
I'm trying to save a model to an endpoint but I just can't figure out how to send the data:
var fav = Alloy.createModel('favourite'); fav.save({item_id: item._id}, { success: function(){ Ti.API.info('Success'); }, error: function(){ Ti.API.info('error'); } });
Also tried:
var fav = Alloy.createModel('favourite'); fav.set('item_id', item._id); fav.save({}, { success: function(){ Ti.API.info('Success'); }, error: function(){ Ti.API.info('error'); } });
With debug on I can see the output:
"url": "http://localhost:4000/users/me/favourites", "data": "{}"
How do I send params along with the save?
Please use Q&A for this kind of questions.
I'm trying to save a model to an endpoint but I just can't figure out how to send the data:
Also tried:
With debug on I can see the output:
"url": "http://localhost:4000/users/me/favourites", "data": "{}"
How do I send params along with the save?