liquid_feedback_frontend
diff app/main/api/member.lua @ 1843:b01d9920371b
merge
author | jbe |
---|---|
date | Thu Feb 03 15:57:22 2022 +0100 (2022-02-03) |
parents | ddbd46a34b6a |
children |
line diff
1.1 --- a/app/main/api/member.lua Thu Feb 03 15:54:23 2022 +0100 1.2 +++ b/app/main/api/member.lua Thu Feb 03 15:57:22 2022 +0100 1.3 @@ -54,6 +54,23 @@ 1.4 selector:add_where{ "name ILIKE ? OR identification ILIKE ?", search, search } 1.5 end 1.6 1.7 +if app.scopes.read_profiles then 1.8 + local profile_lookups = false 1.9 + for i, field in ipairs(config.member_profile_fields) do 1.10 + if field.api_lookup then 1.11 + local value = param.get("profile_" .. field.id) 1.12 + if value then 1.13 + selector:add_where{ "member_profile.profile->>? = ?", field.id, value } 1.14 + profile_lookups = true 1.15 + end 1.16 + end 1.17 + end 1.18 + if profile_lookups then 1.19 + selector:join("member_profile", nil, "member_profile.member_id = member.id") 1.20 + end 1.21 +end 1.22 + 1.23 + 1.24 local members = selector:exec() 1.25 local r = json.object() 1.26 r.result = execute.chunk{ module = "api", chunk = "_member", params = {