Update getUser API and add it to the JS driver (#4020)
Этот коммит содержится в:
коммит произвёл
enahum
родитель
abe6e8e471
Коммит
837808eba3
@@ -856,6 +856,15 @@ export default class Client {
|
||||
end(this.handleResponse.bind(this, 'getMe', success, error));
|
||||
}
|
||||
|
||||
getUser(userId, success, error) {
|
||||
request.
|
||||
get(`${this.getUserNeededRoute(userId)}/get`).
|
||||
set(this.defaultHeaders).
|
||||
type('application/json').
|
||||
accept('application/json').
|
||||
end(this.handleResponse.bind(this, 'getUser', success, error));
|
||||
}
|
||||
|
||||
login(loginId, password, mfaToken, success, error) {
|
||||
this.doLogin({login_id: loginId, password, token: mfaToken}, success, error);
|
||||
|
||||
|
||||
@@ -21,6 +21,21 @@ describe('Client.User', function() {
|
||||
});
|
||||
});
|
||||
|
||||
it('getUser', function(done) {
|
||||
TestHelper.initBasic(() => {
|
||||
TestHelper.basicClient().getUser(
|
||||
TestHelper.basicUser().id,
|
||||
function(data) {
|
||||
assert.equal(data.id, TestHelper.basicUser().id);
|
||||
done();
|
||||
},
|
||||
function(err) {
|
||||
done(new Error(err.message));
|
||||
}
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
it('getInitialLoad', function(done) {
|
||||
TestHelper.initBasic(() => {
|
||||
TestHelper.basicClient().getInitialLoad(
|
||||
|
||||
Ссылка в новой задаче
Block a user