Skip to content

Commit ef0ba71

Browse files
committed
dynamic content fix
1 parent d9ed3c2 commit ef0ba71

File tree

2 files changed

+41
-40
lines changed

2 files changed

+41
-40
lines changed

lib/click/examples/embedClickwrap.js

Lines changed: 37 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -18,43 +18,44 @@
1818
* @param {string} args.documentArgs.jobTitle
1919
* @param {string} args.documentArgs.date
2020
*/
21-
const embedClickwrap = async (args) => {
22-
// Step 3. Construct the request Body
23-
const documentArgs = {
24-
fullName: args.documentArgs.fullName,
25-
email: args.documentArgs.email,
26-
company: args.documentArgs.company,
27-
jobTitle: args.documentArgs.jobTitle,
28-
date: args.documentArgs.date,
29-
};
30-
21+
22+
const embedClickwrap = async (args) => {
23+
24+
const documentArgs = {
25+
fullName: args.documentArgs.fullName,
26+
email: args.documentArgs.email,
27+
company: args.documentArgs.company,
28+
jobTitle: args.documentArgs.jobTitle,
29+
date: args.documentArgs.date,
30+
};
31+
3132
const userAgreement = new docusignClick.UserAgreementRequest.constructFromObject({
32-
clientUserId: documentArgs.email,
33-
documentData: {
34-
fullName: documentArgs.fullName,
35-
email: documentArgs.email,
36-
company: documentArgs.company,
37-
title: documentArgs.jobTitle,
38-
date: documentArgs.date,
39-
},
40-
});
41-
42-
43-
// Step 4. Call the Click API
44-
const dsApiClient = new docusignClick.ApiClient();
45-
dsApiClient.setBasePath(args.basePath);
46-
dsApiClient.addDefaultHeader("Authorization", "Bearer " + args.accessToken);
47-
const accountApi = new docusignClick.AccountsApi(dsApiClient);
48-
49-
// Embed the clickwrap
50-
const result = await accountApi.createHasAgreed(
51-
args.accountId, args.clickwrapId, {
52-
userAgreementRequest: userAgreement
53-
});
54-
console.log(`See the embedded clickwrap on this page:`);
55-
return result;
56-
57-
};
33+
clientUserId: documentArgs.email,
34+
documentData: {
35+
fullName: documentArgs.fullName,
36+
email: documentArgs.email,
37+
company: documentArgs.company,
38+
title: documentArgs.jobTitle,
39+
date: documentArgs.date,
40+
},
41+
// requireReacceptance: true,
42+
});
43+
44+
45+
// Step 4. Call the Click API
46+
const dsApiClient = new docusignClick.ApiClient();
47+
dsApiClient.setBasePath(args.basePath);
48+
dsApiClient.addDefaultHeader("Authorization", "Bearer " + args.accessToken);
49+
const accountApi = new docusignClick.AccountsApi(dsApiClient);
50+
51+
// Embed the clickwrap
52+
const result = await accountApi.createHasAgreed(
53+
args.accountId, args.clickwrapId, {
54+
userAgreementRequest: userAgreement
55+
});
56+
console.log(`See the embedded clickwrap in the dialog box.`);
57+
return result;
58+
};
5859

5960
const getActiveClickwraps = async (args) => {
6061
// Call the Click API

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)