@shoutem/api-sdk
Advanced tools
Comparing version 1.0.1-beta.2 to 1.1.0
@@ -15,10 +15,12 @@ 'use strict'; | ||
function getError(action) { | ||
var errors = _lodash2.default.get(action, ['payload', 'response', 'errors'], []); | ||
return _lodash2.default.get(errors, '0', {}); | ||
function getError(response) { | ||
return response.clone().json().then(function (jsonResponse) { | ||
return _lodash2.default.get(jsonResponse, 'errors', []); | ||
}); | ||
} | ||
function getErrorCode(action) { | ||
var error = getError(action); | ||
return _lodash2.default.get(error, 'code'); | ||
function getErrorCode(response) { | ||
return getError(response).then(function (error) { | ||
return _lodash2.default.get(error, 'code'); | ||
}); | ||
} |
{ | ||
"name": "@shoutem/api-sdk", | ||
"version": "1.0.1-beta.2", | ||
"version": "1.1.0", | ||
"description": "Javascript SDK for Shoutem API using fetch", | ||
@@ -5,0 +5,0 @@ "main": "build/lib/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
30683
662
1