Skip to content

Commit 6ceb8d8

Browse files
committed
fixing step 5 API call
1 parent 6e1a505 commit 6ceb8d8

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

lib/rooms/examples/grantOfficeAccessToFormGroup.js

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,6 @@ const docusignRooms = require("docusign-rooms");
1010
* Get form groups
1111
* @param {object} args
1212
*/
13-
const grantOfficeAccessToFormGroup = async (args) => {
14-
// Create an API with headers
15-
let dsApiClient = new docusignRooms.ApiClient();
16-
dsApiClient.setBasePath(args.basePath);
17-
dsApiClient.addDefaultHeader("Authorization", "Bearer " + args.accessToken);
18-
19-
// GET Form Groups via FormGroupsAPI
20-
// Step 4 start
21-
const formsGroupsApi = new docusignRooms.FormGroupsApi(dsApiClient);
22-
const results = await formsGroupsApi.getFormGroups(args.accountId);
23-
// Step 4 end
24-
25-
return results.formGroups;
26-
};
2713

2814
/**
2915
* Get offices
@@ -55,10 +41,10 @@ const getFormGroups = async (args) => {
5541
dsApiClient.addDefaultHeader("Authorization", "Bearer " + args.accessToken);
5642

5743
// GET offices via OfficesApi
58-
// Step 3 start
44+
// Step 4 start
5945
const officesApi = new docusignRooms.FormGroupsApi(dsApiClient);
6046
const results = await officesApi.getFormGroups(args.accountId);
61-
// Step 3 end
47+
// Step 4 end
6248

6349
return results.formGroups;
6450
};
@@ -75,4 +61,18 @@ const getFormGroupsAndOffices = async (args) => {
7561
return { formGroups, offices };
7662
};
7763

64+
const grantOfficeAccessToFormGroup = async (args) => {
65+
// Create an API with headers
66+
let dsApiClient = new docusignRooms.ApiClient();
67+
dsApiClient.setBasePath(args.basePath);
68+
dsApiClient.addDefaultHeader("Authorization", "Bearer " + args.accessToken);
69+
70+
// Step 5 start
71+
const formsGroupsApi = new docusignRooms.FormGroupsApi(dsApiClient);
72+
const results = await formsGroupsApi.grantOfficeAccessToFormGroup(args.accountId, args.formGroupId, args.officeId);
73+
// Step 5 end
74+
75+
return results;
76+
};
77+
7878
module.exports = { grantOfficeAccessToFormGroup, getFormGroupsAndOffices };

0 commit comments

Comments
 (0)