Skip to content

Commit

Permalink
Update listUsers options
Browse files Browse the repository at this point in the history
Update the list for filter users as for v4 API documentation.
https://docs.hyperwallet.com/content/api/v4/resources/users/list
  • Loading branch information
maxe2y committed Nov 13, 2020
1 parent 6336036 commit b7dddff
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Hyperwallet.js
Expand Up @@ -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));
}
Expand Down
5 changes: 4 additions & 1 deletion test/Hyperwallet.spec.js
Expand Up @@ -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", () => {
Expand Down

0 comments on commit b7dddff

Please sign in to comment.