Skip to content
This repository was archived by the owner on Jan 23, 2025. It is now read-only.

Commit e11ebe2

Browse files
committed
Merge pull request #391 from cloudspokes/terms-fix
Add agreed url parameter to the terms API
2 parents cbc7e9e + 5f5dfb7 commit e11ebe2

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

actions/terms.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ var getTermsOfUse = function (api, connection, dbConnectionMap, next) {
5858
return;
5959
}
6060

61+
sqlParams.userId = connection.caller.userId;
62+
6163
async.waterfall([
6264
function (cb) {
6365
// validate termsOfUseId parameter and set sql parameter

queries/get_terms_of_use

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@ SELECT tou.terms_of_use_id as terms_of_use_id,
44
touat.name as agreeability_type,
55
tou.terms_text as text,
66
touat.terms_of_use_agreeability_type_id as agreeability_type_id,
7-
toudtx.docusign_template_id as docusign_template_id
7+
toudtx.docusign_template_id as docusign_template_id,
8+
(utuox.user_id IS NOT NULL) as agreed
89
FROM terms_of_use tou
910
INNER JOIN terms_of_use_agreeability_type_lu touat ON touat.terms_of_use_agreeability_type_id = tou.terms_of_use_agreeability_type_id
1011
LEFT JOIN terms_of_use_docusign_template_xref toudtx ON toudtx.terms_of_use_id = tou.terms_of_use_id
12+
LEFT JOIN user_terms_of_use_xref utuox ON utuox.terms_of_use_id = tou.terms_of_use_id AND utuox.user_id = @userId@
1113
WHERE tou.terms_of_use_id = @termsOfUseId@

0 commit comments

Comments
 (0)