From 8d4e95f41216b23307dca0c6e9fac03337badd22 Mon Sep 17 00:00:00 2001 From: Scripnic Alexandru Date: Mon, 19 Oct 2015 12:43:21 +0300 Subject: [PATCH] change: get item from body error --- src/client.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/client.js b/src/client.js index 413f95f..ef192cf 100644 --- a/src/client.js +++ b/src/client.js @@ -197,7 +197,7 @@ export default class Client { listDeployments({ restapiId }) { return this.getFetcher().get( `${this._getBaseUrl()}/restapis/${restapiId}/deployments` - ).then(body => body.item.map(source => new Deployment(source))); + ).then(body => body._embedded.item.map(source => new Deployment(source))); } /** @@ -207,7 +207,7 @@ export default class Client { listResources({ restapiId }) { return this.getFetcher().get( `${this._getBaseUrl()}/restapis/${restapiId}/resources` - ).then(body => body.item.map(source => new Resource(source))); + ).then(body => body._embedded.item.map(source => new Resource(source))); } /** @@ -216,7 +216,7 @@ export default class Client { listRestapis() { return this.getFetcher().get( `${this._getBaseUrl()}/restapis` - ).then(body => body.item.map(source => new Restapi(source))); + ).then(body => body._embedded.item.map(source => new Restapi(source))); } /**