From 79b15b5a00ec3efed2193d3d16f61417bfcc933d Mon Sep 17 00:00:00 2001 From: mjuniper Date: Fri, 19 Jul 2019 11:26:46 -0600 Subject: [PATCH] fix(portal): searchGroupUsers will now respect joined and memberType parameters AFFECTS PACKAGES: @esri/arcgis-rest-portal --- packages/arcgis-rest-portal/src/groups/get.ts | 4 +++- packages/arcgis-rest-portal/test/groups/get.test.ts | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/arcgis-rest-portal/src/groups/get.ts b/packages/arcgis-rest-portal/src/groups/get.ts index bb68b1a1b6..491d46d13d 100644 --- a/packages/arcgis-rest-portal/src/groups/get.ts +++ b/packages/arcgis-rest-portal/src/groups/get.ts @@ -107,6 +107,8 @@ export interface ISearchGroupUsersOptions name?: string; sortField?: string; sortOrder?: string; + joined?: number | number[]; + memberType?: string; [key: string]: any; } @@ -139,7 +141,7 @@ export function searchGroupUsers( const url = `${getPortalUrl(searchOptions)}/community/groups/${id}/userlist`; const options = appendCustomParams( searchOptions, - ["name", "num", "start", "sortField", "sortOrder"], + ["name", "num", "start", "sortField", "sortOrder", "joined", "memberType"], { httpMethod: "GET" } diff --git a/packages/arcgis-rest-portal/test/groups/get.test.ts b/packages/arcgis-rest-portal/test/groups/get.test.ts index ed379c547e..4cc3a7f41f 100644 --- a/packages/arcgis-rest-portal/test/groups/get.test.ts +++ b/packages/arcgis-rest-portal/test/groups/get.test.ts @@ -113,7 +113,9 @@ describe("groups", () => { sortField: "fullname", sortOrder: "asc", num: 2, - start: 2 + start: 2, + joined: [null, 123456], + memberType: "member" }, ...MOCK_REQOPTS }) @@ -121,7 +123,7 @@ describe("groups", () => { expect(fetchMock.called()).toEqual(true); const [url, options]: [string, RequestInit] = fetchMock.lastCall("*"); expect(url).toEqual( - "https://myorg.maps.arcgis.com/sharing/rest/community/groups/5bc/userlist?f=json&name=jupe&sortField=fullname&sortOrder=asc&num=2&start=2&token=fake-token" + "https://myorg.maps.arcgis.com/sharing/rest/community/groups/5bc/userlist?f=json&name=jupe&sortField=fullname&sortOrder=asc&num=2&start=2&joined=%2C123456&memberType=member&token=fake-token" ); expect(options.method).toBe("GET"); done();