@@ -32,7 +32,7 @@ function getTermsInit(arg) {
32
32
* @return {Action }
33
33
*/
34
34
function getTermsDone ( entity , tokens , mockAgreed ) {
35
- const service = getService ( tokens . tokenV2 ) ;
35
+ const service = getService ( tokens . tokenV3 ) ;
36
36
let termsPromise ;
37
37
38
38
// if mockAgreed=true passed, then we create an array of 10 true which we pass to the
@@ -44,7 +44,7 @@ function getTermsDone(entity, tokens, mockAgreed) {
44
44
45
45
switch ( entity . type ) {
46
46
case 'challenge' : {
47
- termsPromise = service . getChallengeTerms ( entity . id , mockAgreedArray ) ;
47
+ termsPromise = service . getChallengeTerms ( entity . terms , mockAgreedArray ) ;
48
48
break ;
49
49
}
50
50
case 'community' : {
@@ -59,7 +59,7 @@ function getTermsDone(entity, tokens, mockAgreed) {
59
59
throw new Error ( `Entity type '${ entity . type } ' is not supported by getTermsDone.` ) ;
60
60
}
61
61
62
- return termsPromise . then ( res => ( { entity, terms : res . terms } ) ) ;
62
+ return termsPromise . then ( res => ( { entity, terms : res } ) ) ;
63
63
}
64
64
65
65
/**
@@ -152,11 +152,11 @@ function getTermDetailsInit(termId) {
152
152
* @static
153
153
* @desc Creates an action that fetches details of the specified term.
154
154
* @param {Number|String } termId
155
- * @param {String } tokenV2
155
+ * @param {String } tokenV3
156
156
* @return {Action }
157
157
*/
158
- function getTermDetailsDone ( termId , tokenV2 ) {
159
- const service = getService ( tokenV2 ) ;
158
+ function getTermDetailsDone ( termId , tokenV3 ) {
159
+ const service = getService ( tokenV3 ) ;
160
160
return service . getTermDetails ( termId ) . then ( details => ( { termId, details } ) ) ;
161
161
}
162
162
@@ -175,11 +175,11 @@ function getDocuSignUrlInit(templateId) {
175
175
* @desc Creates an action that generates the url of DoduSign term
176
176
* @param {Number|String } templateId id of document template to sign
177
177
* @param {String } returnUrl callback url after finishing singing
178
- * @param {String } tokenV2 auth token
178
+ * @param {String } tokenV3 auth token
179
179
* @return {Action }
180
180
*/
181
- function getDocuSignUrlDone ( templateId , returnUrl , tokenV2 ) {
182
- const service = getService ( tokenV2 ) ;
181
+ function getDocuSignUrlDone ( templateId , returnUrl , tokenV3 ) {
182
+ const service = getService ( tokenV3 ) ;
183
183
return service . getDocuSignUrl ( templateId , returnUrl )
184
184
. then ( resp => ( { templateId, docuSignUrl : resp . recipientViewUrl } ) ) ;
185
185
}
@@ -198,11 +198,11 @@ function agreeTermInit(termId) {
198
198
* @static
199
199
* @desc Creates an action that agrees to a term.
200
200
* @param {Number|String } termId id of term
201
- * @param {String } tokenV2 auth token
201
+ * @param {String } tokenV3 auth token
202
202
* @return {Action }
203
203
*/
204
- function agreeTermDone ( termId , tokenV2 ) {
205
- const service = getService ( tokenV2 ) ;
204
+ function agreeTermDone ( termId , tokenV3 ) {
205
+ const service = getService ( tokenV3 ) ;
206
206
return service . agreeTerm ( termId ) . then ( resp => ( { termId, success : resp . success } ) ) ;
207
207
}
208
208
0 commit comments