Set `last_reports_visit` when visiting the reports listing

This commit is contained in:
Andreas Nedbal 2024-03-01 22:10:27 +01:00 committed by Andreas Nedbal
parent 175a044fbf
commit f3cba7b620
1 changed files with 6 additions and 0 deletions

View File

@ -4,6 +4,7 @@ class Moderation::ReportsController < ApplicationController
before_action :authenticate_user! before_action :authenticate_user!
before_action :set_filter_enabled before_action :set_filter_enabled
before_action :set_type_options before_action :set_type_options
before_action :set_last_reports_visit
def index def index
filter = ReportFilter.new(filter_params) filter = ReportFilter.new(filter_params)
@ -39,4 +40,9 @@ class Moderation::ReportsController < ApplicationController
[t("activerecord.models.user.one"), :user] [t("activerecord.models.user.one"), :user]
] ]
end end
def set_last_reports_visit
current_user.last_reports_visit = DateTime.now
current_user.save
end
end end