mirror of
https://github.com/Ionaru/easy-markdown-editor
synced 2025-09-24 16:40:55 -06:00
Change Json response to match with Rails
This commit is contained in:
parent
5f285cefc2
commit
0fc276c9b3
@ -2379,8 +2379,8 @@ EasyMDE.prototype.uploadImage = function (file, onSuccess, onError) {
|
||||
onErrorSup(fillErrorMessage(self.options.errorMessages.importError));
|
||||
return;
|
||||
}
|
||||
if (this.status === 200 && response && !response.error && response.data && response.data.filePath) {
|
||||
onSuccess((self.options.imagePathAbsolute ? '' : (window.location.origin + '/')) + response.data.filePath);
|
||||
if (this.status === 200 || this.status === 201 && response && !response.error && response.data && response.data.slug) {
|
||||
onSuccess((self.options.imagePathAbsolute ? '' : (window.location.origin + '/thumbs/')) + response.data.slug);
|
||||
} else {
|
||||
if (response.error && response.error in self.options.errorMessages) { // preformatted error message
|
||||
onErrorSup(fillErrorMessage(self.options.errorMessages[response.error]));
|
||||
|
Loading…
x
Reference in New Issue
Block a user