-
-
Save attashe/858e587d52d0e5cadc0508e18e9580cb 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
function getImageUrl(name, message, imageBase64) { | |
let parseFile = new Parse.File(name, imageBase64); | |
let Telegram = Parse.Object.extend('Telegram'); | |
let p = new Telegram(); | |
p.set('message', message); | |
p.set('image', parseFile); | |
p.save().then(function() { | |
// The file has been saved to Parse. | |
let q = new Parse.Query('Telegram'); | |
q.addDescending('createdAt'); | |
q.limit(1); | |
q.find({ | |
success: function (results) { | |
ev = results[0]; | |
return ev.get('image').url() | |
}, | |
error: function (error) { | |
alert("Events load error"); | |
} | |
}) | |
}, function(error) { | |
// The file either could not be read, or could not be saved to Parse. | |
alert("was error") | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment