liquid_feedback_frontend
annotate app/main/area/_action/update_ignore.lua @ 1553:282c46bccb7a
merge
author | bsw |
---|---|
date | Wed Oct 28 18:01:52 2020 +0100 (2020-10-28) |
parents | 55132e0324a4 |
children |
rev | line source |
---|---|
bsw@1254 | 1 local area_id = assert(param.get("area_id", atom.integer), "no area id given") |
bsw@1254 | 2 |
bsw@1254 | 3 |
bsw@1254 | 4 local ignored_area = IgnoredArea:by_pk(app.session.member_id, area_id) |
bsw@1254 | 5 |
bsw@1254 | 6 if param.get("delete", atom.boolean) then |
bsw@1254 | 7 if ignored_area then |
bsw@1254 | 8 ignored_area:destroy() |
bsw@1254 | 9 slot.select("notice", function() ui.tag{ content = _"You have been subscribed for update emails about this subject area" } end) |
bsw@1254 | 10 end |
bsw@1254 | 11 return |
bsw@1254 | 12 end |
bsw@1254 | 13 |
bsw@1254 | 14 if not ignored_area then |
bsw@1254 | 15 local ignored_area = IgnoredArea:new() |
bsw@1254 | 16 ignored_area.member_id = app.session.member_id |
bsw@1254 | 17 ignored_area.area_id = area_id |
bsw@1254 | 18 ignored_area:save() |
bsw@1254 | 19 slot.select("notice", function() ui.tag{ content = _"You will no longer receive update emails about this subject area" } end ) |
bsw@1254 | 20 |
bsw@1254 | 21 end |