Skip to content

Instantly share code, notes, and snippets.

@mattatcha
Last active August 29, 2015 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save mattatcha/9cf75d5133258cadc8d5 to your computer and use it in GitHub Desktop.
Save mattatcha/9cf75d5133258cadc8d5 to your computer and use it in GitHub Desktop.
saveImage: function(e){
var this$ = this;
console.log("save");
console.log(API.usages + "/" + this.props.usageNumber + API.newImage);
console.log(this.state.imageURI);
e.preventDefault();
request.put(API.usages + "/" + this.props.usageNumber + API.newImage).attach('image', this.state.imageURI).end(function(res){
console.log(res);
return console.log(this$.state.imageURI);
});
},
save-image: (e) !->
console.log "save"
console.log API.usages + "/" + @props.usageNumber + API.newImage
console.log @state.imageURI
e.prevent-default!
do
res <~ request.put API.usages + "/" + @props.usageNumber + API.newImage
.attach 'image', @state.imageURI
.end
console.log res
console.log @state.imageURI
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment