liquid_feedback_frontend
diff app/main/api/support.lua @ 1500:71f54c43d7cb
Added API support interface
author | bsw |
---|---|
date | Tue Mar 24 16:59:32 2020 +0100 (2020-03-24) |
parents | |
children | 37a366b86b49 |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/app/main/api/support.lua Tue Mar 24 16:59:32 2020 +0100 1.3 @@ -0,0 +1,17 @@ 1.4 +local initiative_id = param.get("initiative_id") 1.5 + 1.6 +local success = util.add_support(initiative_id) 1.7 + 1.8 +slot.set_layout(nil, "application/json") 1.9 + 1.10 +local r = json.array() 1.11 + 1.12 +if success then 1.13 + r.status = "ok" 1.14 +else 1.15 + r.status = "error" 1.16 +end 1.17 + 1.18 +slot.put_into("data", json.export(json.object{ result = r })) 1.19 +slot.put_into("data", "\n") 1.20 +