Changeset

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 4356:ab2e15d3f1fa
children 4358:d3e0fe470877
files mod_http_admin_api/mod_http_admin_api.lua mod_invites/mod_invites.lua
diffstat 2 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/mod_http_admin_api/mod_http_admin_api.lua	Mon Jan 18 20:01:17 2021 +0100
+++ b/mod_http_admin_api/mod_http_admin_api.lua	Tue Jan 19 20:34:23 2021 +0000
@@ -116,13 +116,13 @@
 
 	local invite;
 	if invite_options and invite_options.reusable then
-		invite = invites.create_group(invite_options.group, invite_options.ttl, {
+		invite = invites.create_group(invite_options.groups, invite_options.ttl, {
 			source = "admin_api/"..event.session.username;
 		});
 	else
 		invite = invites.create_account(nil, {
 			source = "admin_api/"..event.session.username;
-			groups = { invite_options.group };
+			groups = invite_options.groups;
 		});
 	end
 	if not invite then
--- a/mod_invites/mod_invites.lua	Mon Jan 18 20:01:17 2021 +0100
+++ b/mod_invites/mod_invites.lua	Tue Jan 19 20:34:23 2021 +0000
@@ -84,9 +84,9 @@
 -- Create invitation to register an account and join a user group
 -- If explicit ttl is passed, invite is valid for multiple signups
 -- during that time period
-function create_group(group_id, ttl, additional_data) --luacheck: ignore 131/create_group
+function create_group(group_ids, ttl, additional_data) --luacheck: ignore 131/create_group
 	local merged_additional_data = {
-		groups = { group_id };
+		groups = group_ids;
 	};
 	if merged_additional_data then
 		for k, v in pairs(additional_data) do