liquid_feedback_frontend
view app/main/area/_action/update_ignore.lua @ 1546:ae194d0235c2
Set session cookie only if session is needed
| author | bsw | 
|---|---|
| date | Thu Oct 22 11:57:23 2020 +0200 (2020-10-22) | 
| parents | 55132e0324a4 | 
| children | 
 line source
     1 local area_id = assert(param.get("area_id", atom.integer), "no area id given")
     4 local ignored_area = IgnoredArea:by_pk(app.session.member_id, area_id)
     6 if param.get("delete", atom.boolean) then
     7   if ignored_area then
     8     ignored_area:destroy()
     9     slot.select("notice", function() ui.tag{ content = _"You have been subscribed for update emails about this subject area" } end)
    10   end
    11   return
    12 end
    14 if not ignored_area then
    15   local ignored_area = IgnoredArea:new()
    16   ignored_area.member_id = app.session.member_id
    17   ignored_area.area_id = area_id
    18   ignored_area:save()
    19   slot.select("notice", function() ui.tag{ content = _"You will no longer receive update emails about this subject area" }  end )
    21 end
