diff --git a/app/controllers/api/v1/notifications_controller.rb b/app/controllers/api/v1/notifications_controller.rb index 3cff299820e0f26b8d21a402ea082a8b87ea1e4b..e79434f1da98faad974d40ef0cdbe0005a6cf7b0 100644 --- 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 index bc67016a487d06e074403787b18f1046f39ffa38..d9b36661e62cb67315625db4fd782c4a4fa356a0 100644 --- 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