Skip to content

Commit 722982c

Browse files
Fixed eg006 and eg008 rooms examples
1 parent ca5f7f7 commit 722982c

2 files changed

Lines changed: 13 additions & 26 deletions

File tree

lib/rooms/examples/createExternalFormFillSession.js

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,8 @@ const createExternalFormFillSession = async (args) => {
2424

2525
externalForm =
2626
await externalFormFillSessionApi.createExternalFormFillSession(
27-
req.session.accountId,
28-
{ body: { formId: docuSignFormId, roomId: args.roomId } },
29-
null
27+
args.accountId,
28+
{ body: { formId: args.docuSignFormId, roomId: args.roomId } }
3029
);
3130

3231
return externalForm;
@@ -37,9 +36,7 @@ const createExternalFormFillSession = async (args) => {
3736

3837
roomDocuments = await roomsApi.getDocuments(
3938
args.accountId,
40-
args.roomId,
41-
null,
42-
null
39+
args.roomId
4340
);
4441
return roomDocuments;
4542
}
@@ -58,11 +55,10 @@ const getRooms = async (args) => {
5855

5956
userRooms = await roomsApi.getRooms(
6057
args.accountId,
61-
{ count: 5 } /*optional*/,
62-
null
58+
{ count: 5 } /*optional*/
6359
);
6460

65-
return userRoomsl;
61+
return userRooms;
6662
};
6763

6864
module.exports = { createExternalFormFillSession, getRooms };

lib/rooms/examples/grantOfficeAccessToFormGroup.js

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -45,31 +45,22 @@ const getOffices = async (args) => {
4545
};
4646

4747
/**
48-
* Grant office access to form group
48+
* Get form groups
4949
* @param {object} args
5050
*/
51-
const grantAccess = async (args) => {
51+
const getFormGroups = async (args) => {
5252
// Create an API with headers
53-
// Step 2 start
5453
let dsApiClient = new docusignRooms.ApiClient();
5554
dsApiClient.setBasePath(args.basePath);
5655
dsApiClient.addDefaultHeader("Authorization", "Bearer " + args.accessToken);
57-
// Step 2 end
5856

59-
// Post the form object using SDK
60-
// Step 5 start
61-
const formsGroupsApi = new docusignRooms.FormGroupsApi(dsApiClient);
62-
const results = await formsGroupsApi.grantOfficeAccessToFormGroup(
63-
args.accountId,
64-
args.formGroupId,
65-
args.officeId
66-
);
67-
// Step 5 end
57+
// GET offices via OfficesApi
58+
// Step 3 start
59+
const officesApi = new docusignRooms.FormGroupsApi(dsApiClient);
60+
const results = await officesApi.getFormGroups(args.accountId);
61+
// Step 3 end
6862

69-
console.log(
70-
`Office ${args.officeId} has been assigned to Form Group ID ${args.formGroupId}`
71-
);
72-
return results;
63+
return results.formGroups;
7364
};
7465

7566
/**

0 commit comments

Comments
 (0)