Diff

mod_http_admin_api/mod_http_admin_api.lua @ 4350:270025e76bf8

mod_http_admin_api: Use json.encode_array() when returning an array
author Matthew Wild <mwild1@gmail.com>
date Sun, 17 Jan 2021 17:46:47 +0000
parent 4349:5ca36c36ab05
child 4351:c0b1b2a61e3c
line wrap: on
line diff
--- a/mod_http_admin_api/mod_http_admin_api.lua	Sun Jan 17 17:46:02 2021 +0000
+++ b/mod_http_admin_api/mod_http_admin_api.lua	Sun Jan 17 17:46:47 2021 +0000
@@ -81,7 +81,7 @@
 	end);
 
 	event.response.headers["Content-Type"] = json_content_type;
-	return json.encode(invites_list);
+	return json.encode_array(invites_list);
 end
 
 function get_invite_by_id(event, invite_id)
@@ -137,7 +137,7 @@
 	end
 
 	event.response.headers["Content-Type"] = json_content_type;
-	return json.encode(user_list);
+	return json.encode_array(user_list);
 end
 
 function get_user_by_name(event, username)