Skip to content

Instantly share code, notes, and snippets.

@alvnrapada
Last active August 19, 2020 10:34
Show Gist options
  • Save alvnrapada/ce2d7d456d24af6d407958a27bc8ac14 to your computer and use it in GitHub Desktop.
Save alvnrapada/ce2d7d456d24af6d407958a27bc8ac14 to your computer and use it in GitHub Desktop.
_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