# HG changeset patch # User bsw # Date 1606136682 -3600 # Node ID be96623e575ab929276b9bd081629eef01b110f6 # Parent 2aedc4fa7e9f29b3689c31d4e89fd403791a55f3 Allow multiple ids for member endpoint diff -r 2aedc4fa7e9f -r be96623e575a app/main/api/member.lua --- a/app/main/api/member.lua Wed Nov 11 17:23:44 2020 +0100 +++ b/app/main/api/member.lua Mon Nov 23 14:04:42 2020 +0100 @@ -8,8 +8,13 @@ :add_where("activated NOTNULL") :add_order_by("id") -if param.get("id") then - selector:add_where{ "id = ?", param.get("id") } +local id = param.get("id") +if id then + local ids = { sep = ", " } + for match in string.gmatch(id, "[^,]+") do + table.insert(ids, { "?", match }) + end + selector:add_where{ "id IN ($)", ids } end local role = param.get("role")