liquid_feedback_frontend

changeset 1574:be96623e575a

Allow multiple ids for member endpoint
author bsw
date Mon Nov 23 14:04:42 2020 +0100 (2020-11-23)
parents 2aedc4fa7e9f
children 3f3f802354b7
files app/main/api/member.lua
line diff
     1.1 --- a/app/main/api/member.lua	Wed Nov 11 17:23:44 2020 +0100
     1.2 +++ b/app/main/api/member.lua	Mon Nov 23 14:04:42 2020 +0100
     1.3 @@ -8,8 +8,13 @@
     1.4    :add_where("activated NOTNULL")
     1.5    :add_order_by("id")
     1.6  
     1.7 -if param.get("id") then
     1.8 -  selector:add_where{ "id = ?", param.get("id") }
     1.9 +local id = param.get("id")
    1.10 +if id then
    1.11 +  local ids = { sep = ", " }
    1.12 +  for match in string.gmatch(id, "[^,]+") do
    1.13 +    table.insert(ids, { "?", match })
    1.14 +  end
    1.15 +  selector:add_where{ "id IN ($)", ids }
    1.16  end
    1.17  
    1.18  local role = param.get("role")

Impressum / About Us