basic interaction dashboard, interact callback function in consent module

This commit is contained in:
Luke Miller
2021-07-05 17:32:17 -04:00
parent 7318b8d664
commit 1be8e8b23d
5 changed files with 93 additions and 40 deletions

View File

@@ -38,6 +38,16 @@ function modpol.modules.consent:new_process(id, request_id, org_id)
return process
end
-- ============================
-- interact function for the consent module
function modpol.modules.consent:interact(user)
local resp = modpol.interactions.binary_poll_user(user, "How do you vote?")
if resp == 'yes' then
self:approve(user, true)
elseif resp == 'no' then
self:approve(user, false)
end
end
-- =========================================
-- function to delete a process, called when process finishes