comparison mod_http_admin_api/mod_http_admin_api.lua @ 4361:7f1f3b79d991

mod_http_admin_api: Return new group object on successful creation
author Matthew Wild <mwild1@gmail.com>
date Wed, 20 Jan 2021 12:51:33 +0000
parents 76bec3f66b24
children 116c88c28532
comparison
equal deleted inserted replaced
4360:76bec3f66b24 4361:7f1f3b79d991
253 253
254 local ok = group_store:set(group.id, {}); 254 local ok = group_store:set(group.id, {});
255 if not ok then 255 if not ok then
256 return 500; 256 return 500;
257 end 257 end
258 return 200; 258
259 event.response.headers["Content-Type"] = json_content_type;
260 return json.encode({
261 id = group.id or group.name;
262 name = group.name;
263 });
259 end 264 end
260 265
261 function delete_group(event, group_id) --luacheck: ignore 212/event 266 function delete_group(event, group_id) --luacheck: ignore 212/event
262 if not group_id then 267 if not group_id then
263 return 400; 268 return 400;