Add client.cacheUser method (#548)

* Add client.cacheUser method

* Fixed ESLint issues

* Added existence check first
This commit is contained in:
Schuyler Cebulskie
2016-08-27 10:22:07 -04:00
committed by Amish Shah
parent e47f3dda94
commit f944dce5c7
5 changed files with 43 additions and 4 deletions

View File

@@ -193,6 +193,16 @@ class RESTMethods {
});
}
getUser(userID) {
return new Promise((resolve, reject) => {
this.rest.makeRequest('get', Constants.Endpoints.user(userID), true)
.then((data) => {
resolve(this.rest.client.actions.UserGet.handle(data).user);
})
.catch(reject);
});
}
updateCurrentUser(_data) {
return new Promise((resolve, reject) => {
const user = this.rest.client.user;