Last active
August 19, 2020 10:34
-
-
Save alvnrapada/ce2d7d456d24af6d407958a27bc8ac14 to your computer and use it in GitHub Desktop.
This file contains 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
_initListeners( resolve, reject ) { | |
...... | |
xhr.addEventListener( 'load', () => { | |
const response = xhr.response; | |
if ( !response || response.error ) { | |
return reject( response && response.error ? response.error.message : genericErrorText ); | |
} | |
// If the upload is successful, resolve the upload promise with an object containing | |
// at least the "default" URL, pointing to the image on the server. | |
resolve({ | |
default: response.s3Url | |
}); | |
} ); | |
..... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment