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

Add agreed url parameter to the terms API #391

Merged
merged 1 commit into from
Dec 17, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions actions/terms.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ var getTermsOfUse = function (api, connection, dbConnectionMap, next) {
return;
}

sqlParams.userId = connection.caller.userId;

async.waterfall([
function (cb) {
// validate termsOfUseId parameter and set sql parameter
Expand Down
4 changes: 3 additions & 1 deletion queries/get_terms_of_use
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ SELECT tou.terms_of_use_id as terms_of_use_id,
touat.name as agreeability_type,
tou.terms_text as text,
touat.terms_of_use_agreeability_type_id as agreeability_type_id,
toudtx.docusign_template_id as docusign_template_id
toudtx.docusign_template_id as docusign_template_id,
(utuox.user_id IS NOT NULL) as agreed
FROM terms_of_use tou
INNER JOIN terms_of_use_agreeability_type_lu touat ON touat.terms_of_use_agreeability_type_id = tou.terms_of_use_agreeability_type_id
LEFT JOIN terms_of_use_docusign_template_xref toudtx ON toudtx.terms_of_use_id = tou.terms_of_use_id
LEFT JOIN user_terms_of_use_xref utuox ON utuox.terms_of_use_id = tou.terms_of_use_id AND utuox.user_id = @userId@
WHERE tou.terms_of_use_id = @termsOfUseId@