This website works better with JavaScript.
Home
Explore
Help
Sign In
closed-social
/
mastodon
Watch
3
Star
0
Fork
2
Code
Issues
5
Pull Requests
0
Projects
0
Releases
3
Wiki
Activity
Browse Source
Added API for single notification dismissal (
#2251
)
* Added API backend for notification dismissal * Added render statement * Changed statement
closed-social-glitch-2
Ashley
7 years ago
committed by
Eugen
parent
0f852c6f74
commit
05ac28f3e4
2 changed files
with
6 additions
and
0 deletions
Split View
Diff Options
Show Stats
Download Patch File
Download Diff File
+5
-0
app/controllers/api/v1/notifications_controller.rb
+1
-0
config/routes.rb
+ 5
- 0
app/controllers/api/v1/notifications_controller.rb
View File
@ -30,6 +30,11 @@ class Api::V1::NotificationsController < ApiController
render_empty
end
def
dismiss
Notification
.
find_by!
(
account
:
current_account
,
id
:
params
[
:id
]
)
.
destroy!
render_empty
end
private
def
exclude_types
+ 1
- 0
config/routes.rb
View File
@ -148,6 +148,7 @@ Rails.application.routes.draw do
resources
:notifications
,
only
:
[
:index
,
:show
]
do
collection
do
post
:clear
post
:dismiss
end
end
Write
Preview
Loading…
Cancel
Save