liquid_feedback_frontend
annotate app/main/area/_action/update_ignore.lua @ 1851:a01d5c0604de
Removed debug output
| author | bsw | 
|---|---|
| date | Tue Mar 22 10:25:35 2022 +0100 (2022-03-22) | 
| 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 |