liquid_feedback_frontend
diff app/main/api/notify_email.lua @ 1309:32cc544d5a5b
Cumulative patch for upcoming frontend version 4
author | bsw/jbe |
---|---|
date | Sun Jul 15 14:07:29 2018 +0200 (2018-07-15) |
parents | |
children |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/app/main/api/notify_email.lua Sun Jul 15 14:07:29 2018 +0200 1.3 @@ -0,0 +1,16 @@ 1.4 +slot.set_layout(nil, "application/json") 1.5 + 1.6 +local r = json.object{} 1.7 + 1.8 +if not app.scopes.notify_email then 1.9 + return util.api_error(403, "Forbidden", "insufficient_scope", "Scope notify_email required") 1.10 +end 1.11 + 1.12 +if app.access_token.member.notify_email ~= "" then 1.13 + r.notify_email = app.access_token.member.notify_email 1.14 +else 1.15 + r.notify_email = json.null 1.16 +end 1.17 + 1.18 +slot.put_into("data", json.export(json.object{ result = r })) 1.19 +slot.put_into("data", "\n")