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
import superagent from 'superagent'; | |
import Promise from 'promise'; | |
/** | |
* Is this response object considered successful? | |
* @param {Object} res | |
* @returns {boolean} | |
*/ | |
function isSuccess(res:Object) { | |
return res.ok && res.body.status && res.body.status.success && (!res.body.status.errors || !res.body.status.errors.length); |
NewerOlder