comparison mod_invites/mod_invites.lua @ 4357:a49ca492e621

mod_invites, mod_http_admin_api: Allow specifying multiple groups when creating an invite
author Matthew Wild <mwild1@gmail.com>
date Tue, 19 Jan 2021 20:34:23 +0000
parents 0ec482e617bb
children 4b617a246d81
comparison
equal deleted inserted replaced
4356:ab2e15d3f1fa 4357:a49ca492e621
82 end 82 end
83 83
84 -- Create invitation to register an account and join a user group 84 -- Create invitation to register an account and join a user group
85 -- If explicit ttl is passed, invite is valid for multiple signups 85 -- If explicit ttl is passed, invite is valid for multiple signups
86 -- during that time period 86 -- during that time period
87 function create_group(group_id, ttl, additional_data) --luacheck: ignore 131/create_group 87 function create_group(group_ids, ttl, additional_data) --luacheck: ignore 131/create_group
88 local merged_additional_data = { 88 local merged_additional_data = {
89 groups = { group_id }; 89 groups = group_ids;
90 }; 90 };
91 if merged_additional_data then 91 if merged_additional_data then
92 for k, v in pairs(additional_data) do 92 for k, v in pairs(additional_data) do
93 merged_additional_data[k] = v; 93 merged_additional_data[k] = v;
94 end 94 end