@esri/arcgis-rest-portal
Version:
ArcGIS Online and Enterprise content and user helpers for @esri/arcgis-rest-request
50 lines • 1.93 kB
JavaScript
;
/* Copyright (c) 2017-2018 Environmental Systems Research Institute, Inc.
* Apache-2.0 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.leaveGroup = exports.joinGroup = void 0;
const arcgis_rest_request_1 = require("@esri/arcgis-rest-request");
const get_portal_url_js_1 = require("../util/get-portal-url.js");
/**
* Make a request as the authenticated user to join a Group. See the [REST Documentation](https://developers.arcgis.com/rest/users-groups-and-items/join-group.htm) for more information.
*
* ```js
* import { joinGroup } from '@esri/arcgis-rest-portal';
* //
* joinGroup({
* id: groupId,
* authentication
* })
* .then(response)
* ```
*
* @param requestOptions - Options for the request
* @returns A Promise that will resolve with the success/failure status of the request and the groupId.
*/
function joinGroup(requestOptions) {
const url = `${(0, get_portal_url_js_1.getPortalUrl)(requestOptions)}/community/groups/${requestOptions.id}/join`;
return (0, arcgis_rest_request_1.request)(url, requestOptions);
}
exports.joinGroup = joinGroup;
/**
* Make a request as the authenticated user to leave a Group. See the [REST Documentation](https://developers.arcgis.com/rest/users-groups-and-items/leave-group.htm) for more information.
*
* ```js
* import { leaveGroup } from '@esri/arcgis-rest-portal';
*
* leaveGroup({
* id: groupId,
* authentication
* })
* .then(response)
* ```
*
* @param requestOptions - Options for the request
* @returns A Promise that will resolve with the success/failure status of the request and the groupId.
*/
function leaveGroup(requestOptions) {
const url = `${(0, get_portal_url_js_1.getPortalUrl)(requestOptions)}/community/groups/${requestOptions.id}/leave`;
return (0, arcgis_rest_request_1.request)(url, requestOptions);
}
exports.leaveGroup = leaveGroup;
//# sourceMappingURL=join.js.map