mirror of
https://github.com/mastodon/mastodon.git
synced 2024-11-20 11:35:29 +01:00
Added API for single notification dismissal (#2251)
* Added API backend for notification dismissal * Added render statement * Changed statement
This commit is contained in:
parent
0f852c6f74
commit
05ac28f3e4
@ -30,6 +30,11 @@ class Api::V1::NotificationsController < ApiController
|
|||||||
render_empty
|
render_empty
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def dismiss
|
||||||
|
Notification.find_by!(account: current_account, id: params[:id]).destroy!
|
||||||
|
render_empty
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def exclude_types
|
def exclude_types
|
||||||
|
@ -148,6 +148,7 @@ Rails.application.routes.draw do
|
|||||||
resources :notifications, only: [:index, :show] do
|
resources :notifications, only: [:index, :show] do
|
||||||
collection do
|
collection do
|
||||||
post :clear
|
post :clear
|
||||||
|
post :dismiss
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user