liquid_feedback_frontend
annotate app/main/api/notify_email.lua @ 1852:e593570a23c5
More efficient algorithm
| author | bsw |
|---|---|
| date | Tue Mar 22 10:35:44 2022 +0100 (2022-03-22) |
| parents | 32cc544d5a5b |
| children |
| rev | line source |
|---|---|
| bsw/jbe@1309 | 1 slot.set_layout(nil, "application/json") |
| bsw/jbe@1309 | 2 |
| bsw/jbe@1309 | 3 local r = json.object{} |
| bsw/jbe@1309 | 4 |
| bsw/jbe@1309 | 5 if not app.scopes.notify_email then |
| bsw/jbe@1309 | 6 return util.api_error(403, "Forbidden", "insufficient_scope", "Scope notify_email required") |
| bsw/jbe@1309 | 7 end |
| bsw/jbe@1309 | 8 |
| bsw/jbe@1309 | 9 if app.access_token.member.notify_email ~= "" then |
| bsw/jbe@1309 | 10 r.notify_email = app.access_token.member.notify_email |
| bsw/jbe@1309 | 11 else |
| bsw/jbe@1309 | 12 r.notify_email = json.null |
| bsw/jbe@1309 | 13 end |
| bsw/jbe@1309 | 14 |
| bsw/jbe@1309 | 15 slot.put_into("data", json.export(json.object{ result = r })) |
| bsw/jbe@1309 | 16 slot.put_into("data", "\n") |