Skip to content

Instantly share code, notes, and snippets.

@lholmquist
Created June 21, 2013 12:32
Show Gist options
  • Save lholmquist/5830852 to your computer and use it in GitHub Desktop.
Save lholmquist/5830852 to your computer and use it in GitHub Desktop.
var data = {
id: "123456"
....
},
type = "android";
data.id = pushApplicationID + "/" + type;
applicationPipe.save( data, {
success: function( response ) {
console.log( "save successful", response );
app.aerogear.applicationStore.save( response );
},
error: function( error ) {
console.log( "error saving", error );
}
});
//Produces a PUT since an "id" field is present, but needs to be a POST for to access the correct endpoint for variant creation
//ADding the post=true options could make sure a POST is forced
applicationPipe.save( data, {
post: true
success: function( response ) {
console.log( "save successful", response );
app.aerogear.applicationStore.save( response );
},
error: function( error ) {
console.log( "error saving", error );
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment