Skip to content

Instantly share code, notes, and snippets.

@tanepiper
Created March 26, 2014 11:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tanepiper/9781577 to your computer and use it in GitHub Desktop.
Save tanepiper/9781577 to your computer and use it in GitHub Desktop.
Instance.db.Client.find({where: {id: request.params.cid}})
.success(function(client) {
client.updateAttributes(request.payload)
.success(function(client) {
reply(client);
})
.error(function(error) {
reply(error);
});
})
.error(function(error) {
reply(error);
});
Instance.db.Client.update(request.payload, {id: request.params.cid})
.success(function(client) {
console.log('update', client);
reply(client);
})
.error(function(error) {
reply(error);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment