Last active
August 29, 2015 14:02
-
-
Save mattatcha/9cf75d5133258cadc8d5 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
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); | |
}); | |
}, |
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
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