mirror of
https://github.com/Retrospring/retrospring.git
synced 2024-11-20 18:39:52 +01:00
Mark notification as read when visiting service settings
This commit is contained in:
parent
baffd05d6f
commit
d320a74045
1 changed files with 7 additions and 0 deletions
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
class ServicesController < ApplicationController
|
class ServicesController < ApplicationController
|
||||||
before_action :authenticate_user!
|
before_action :authenticate_user!
|
||||||
|
before_action :mark_notifications_as_read, only: %i[index]
|
||||||
|
|
||||||
def index
|
def index
|
||||||
@services = current_user.services
|
@services = current_user.services
|
||||||
|
@ -59,4 +60,10 @@ class ServicesController < ApplicationController
|
||||||
def omniauth_hash
|
def omniauth_hash
|
||||||
request.env["omniauth.auth"]
|
request.env["omniauth.auth"]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def mark_notifications_as_read
|
||||||
|
Notification::ServiceTokenExpired
|
||||||
|
.where(recipient: current_user, new: true)
|
||||||
|
.update_all(new: false) # rubocop:disable Rails/SkipsModelValidations
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue