API v4 (WIP) (#10453)

API v4
This commit is contained in:
Matteo Pagliazzi
2018-06-18 14:40:25 +02:00
committed by GitHub
parent 97a069642d
commit 8be9964483
158 changed files with 631 additions and 348 deletions

View File

@@ -84,7 +84,7 @@ function _parseRes (res) {
if (apiVersion === 'v2') {
return res.body;
} else if (apiVersion === 'v3') {
} else if (apiVersion === 'v3' || apiVersion === 'v4') {
if (res.body.message) {
return {
data: res.body.data,
@@ -104,7 +104,7 @@ function _parseError (err) {
code: err.status,
text: err.response.body.err,
};
} else if (apiVersion === 'v3') {
} else if (apiVersion === 'v3' || apiVersion === 'v4') {
parsedError = {
code: err.status,
error: err.response.body.error,