Skip to content

Commit

Permalink
fix(portal): searchGroupUsers will now respect joined and memberType …
Browse files Browse the repository at this point in the history
…parameters

AFFECTS PACKAGES:
@esri/arcgis-rest-portal
  • Loading branch information
mjuniper committed Jul 19, 2019
1 parent 4de6881 commit 79b15b5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 3 additions & 1 deletion packages/arcgis-rest-portal/src/groups/get.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ export interface ISearchGroupUsersOptions
name?: string;
sortField?: string;
sortOrder?: string;
joined?: number | number[];
memberType?: string;
[key: string]: any;
}

Expand Down Expand Up @@ -139,7 +141,7 @@ export function searchGroupUsers(
const url = `${getPortalUrl(searchOptions)}/community/groups/${id}/userlist`;
const options = appendCustomParams<ISearchGroupUsersOptions>(
searchOptions,
["name", "num", "start", "sortField", "sortOrder"],
["name", "num", "start", "sortField", "sortOrder", "joined", "memberType"],
{
httpMethod: "GET"
}
Expand Down
6 changes: 4 additions & 2 deletions packages/arcgis-rest-portal/test/groups/get.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,15 +113,17 @@ describe("groups", () => {
sortField: "fullname",
sortOrder: "asc",
num: 2,
start: 2
start: 2,
joined: [null, 123456],
memberType: "member"
},
...MOCK_REQOPTS
})
.then(response => {
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();
Expand Down

0 comments on commit 79b15b5

Please sign in to comment.