From b7dddffdc5f36cbe5f867ee30392ace8cf1bdca4 Mon Sep 17 00:00:00 2001 From: maxe2y <55079984+maxe2y@users.noreply.github.com> Date: Fri, 13 Nov 2020 14:09:51 +0100 Subject: [PATCH] Update listUsers options Update the list for filter users as for v4 API documentation. https://docs.hyperwallet.com/content/api/v4/resources/users/list --- src/Hyperwallet.js | 2 +- test/Hyperwallet.spec.js | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Hyperwallet.js b/src/Hyperwallet.js index 4228e74..5d7c2ff 100644 --- a/src/Hyperwallet.js +++ b/src/Hyperwallet.js @@ -90,7 +90,7 @@ export default class Hyperwallet { * @param {api-callback} callback - The callback for this call */ listUsers(options, callback) { - const LIST_USER_FILTERS = ["clientUserId", "email", "programToken", "status", "verificationStatus"]; + const LIST_USER_FILTERS = ["clientUserId", "createdAfter", "createdBefore", "email", "limit", "programToken", "sortBy", "status", "verificationStatus"]; if (options && !this.isValidFilter(options, LIST_USER_FILTERS)) { throw new Error("Invalid Filter. Expected - ".concat(LIST_USER_FILTERS)); } diff --git a/test/Hyperwallet.spec.js b/test/Hyperwallet.spec.js index f746cb8..a302090 100644 --- a/test/Hyperwallet.spec.js +++ b/test/Hyperwallet.spec.js @@ -255,7 +255,10 @@ describe("Hyperwallet", () => { /** @test {Hyperwallet#listUsers} */ it("should throw error for invalid filter", () => { const callback = () => null; - expect(() => client.listUsers({ test1: "value" }, callback)).to.throw("Invalid Filter. Expected - clientUserId,email,programToken,status,verificationStatus"); + expect(() => client.listUsers({ test1: "value" }, callback)) + .to.throw( + "Invalid Filter. Expected - clientUserId,createdAfter,createdBefore,email,limit,programToken,sortBy,status,verificationStatus" + ); }); /** @test {Hyperwallet#listUsers} */ it("should do get call without options", () => {