From 50e1ac36023832cd5d90918cada1813167b5c5af Mon Sep 17 00:00:00 2001 From: Gregor Date: Mon, 25 Jul 2016 11:36:52 -0700 Subject: [PATCH] feat: account.fetch() includes .profile --- lib/fetch.js | 5 +++-- utils/fetch-properties.js | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/fetch.js b/lib/fetch.js index 3a3c631..d747635 100644 --- a/lib/fetch.js +++ b/lib/fetch.js @@ -16,9 +16,10 @@ function fetch (state, path) { return Promise.reject(error) } return internals.fetchProperties({ - url: state.url + '/session/account', + url: state.url + '/session/account?include=profile', sessionId: get(state, 'account.session.id'), - path: path + path: path, + include: 'profile' }) .then(function (properties) { diff --git a/utils/fetch-properties.js b/utils/fetch-properties.js index d284ee1..4e9d7be 100644 --- a/utils/fetch-properties.js +++ b/utils/fetch-properties.js @@ -14,7 +14,7 @@ function fetchProperties (options) { }) .then(function (response) { - var data = deserialise(response.body) + var data = deserialise(response.body, options) return getProperties(data, options.path) })