@@ -47,8 +47,11 @@ async function getTermsOfUse (currentUser, termsOfUseId, query) {
47
47
}
48
48
]
49
49
if ( userId ) {
50
+ // logger.debug(`Getting Terms for User ${userId}`)
51
+
50
52
include . push ( {
51
53
model : UserTermsOfUseXref ,
54
+ as : 'UserTermsOfUseXrefs' ,
52
55
where : { userId } ,
53
56
attributes : [ 'userId' ] ,
54
57
required : false
@@ -71,6 +74,8 @@ async function getTermsOfUse (currentUser, termsOfUseId, query) {
71
74
delete termsOfUse [ 'UserTermsOfUseXrefs.userId' ]
72
75
}
73
76
77
+ // logger.debug(`Raw Returned Data: ${JSON.stringify(termsOfUse)}`)
78
+
74
79
return convertRawData ( termsOfUse )
75
80
}
76
81
@@ -462,7 +467,7 @@ async function searchTermsOfUses (criteria) {
462
467
463
468
const query = {
464
469
order : [ [ 'id' , 'ASC' ] ] ,
465
- attributes : [ 'id' , 'legacyId' , 'title' , 'url' , 'agreeabilityTypeId' ] ,
470
+ attributes : [ 'id' , 'legacyId' , 'title' , 'url' , 'agreeabilityTypeId' , 'typeId' ] ,
466
471
include,
467
472
where,
468
473
limit : perPage ,
@@ -472,7 +477,7 @@ async function searchTermsOfUses (criteria) {
472
477
473
478
const result = await TermsOfUse . findAll ( query )
474
479
475
- logger . debug ( `Query: ${ JSON . stringify ( query ) } ` )
480
+ // logger.debug(`Query: ${JSON.stringify(query)}`)
476
481
477
482
for ( const element of result ) {
478
483
convertRawData ( element , false )
0 commit comments