Created
June 21, 2013 12:32
-
-
Save lholmquist/5830852 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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