Success using nested functions for requests on CLI
This commit is contained in:
parent
82226f71b1
commit
4016aa77cc
@ -9,16 +9,25 @@ test_org = modpol.instance:add_org('test_org', 'luke')
|
|||||||
print('\nAdding user "nathan" to test_org')
|
print('\nAdding user "nathan" to test_org')
|
||||||
test_org:add_member('nathan')
|
test_org:add_member('nathan')
|
||||||
|
|
||||||
print('\nTrying to remove user "nathan" from empty member list')
|
print("\nOkay, let's start with requests. Setting up an org...")
|
||||||
test_org:remove_member('nathan')
|
modpol.instance:add_org('test_org', 'luke')
|
||||||
|
test_org:add_member('nathan')
|
||||||
|
|
||||||
print('\nInteractive test poll with nested functions...')
|
print('\nMaking consent the add_member policy')
|
||||||
modpol.interactions.text_query(
|
test_org:set_policy("add_member", "consent", false);
|
||||||
"nathan","Poll question:",
|
|
||||||
function(input)
|
print('\nMaking a request to add Josh')
|
||||||
modpol.interactions.binary_poll_user(
|
add_josh = {
|
||||||
"nathan", input,
|
user = "josh",
|
||||||
function(response)
|
type = "add_member",
|
||||||
print("Poll successful!")
|
params = {"josh"}
|
||||||
end)
|
}
|
||||||
end)
|
request_id = test_org:make_request(add_josh)
|
||||||
|
|
||||||
|
|
||||||
|
print('\nHave the two members vote on it')
|
||||||
|
modpol.interactions.org_dashboard("nathan","test_org")
|
||||||
|
modpol.interactions.org_dashboard("nathan","test_org")
|
||||||
|
|
||||||
|
|
||||||
|
-- check a member's dashboard for the process, try to initialize it
|
||||||
|
Loading…
x
Reference in New Issue
Block a user