commit: 05ac28f3e451c9239093f55a32e9f1eda770f8fa
parent: 0f852c6f749dcee61758c4c5ccd94be98f29512c
Author: Ashley <expenses@airmail.cc>
Date: Sat, 22 Apr 2017 12:30:35 +1200
Added API for single notification dismissal (#2251)
* Added API backend for notification dismissal
* Added render statement
* Changed statement
Diffstat:
2 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/app/controllers/api/v1/notifications_controller.rb b/app/controllers/api/v1/notifications_controller.rb
@@ -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
diff --git a/config/routes.rb b/config/routes.rb
@@ -148,6 +148,7 @@ Rails.application.routes.draw do
resources :notifications, only: [:index, :show] do
collection do
post :clear
+ post :dismiss
end
end