about summary refs log tree commit diff
path: root/app/controllers/api/v1/notifications_controller.rb
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2017-01-23 21:09:27 +0100
committerEugen Rochko <eugen@zeonfederated.com>2017-01-23 21:09:27 +0100
commitf392030ab82a70086f93bb02c3faab53c3fbd28e (patch)
treeb2dc190e9f11a2bb9ab0af55c0b7380832bbfbf3 /app/controllers/api/v1/notifications_controller.rb
parentf2e08ff56855a2b14567f6218900823664a0ee2c (diff)
Add /api/v1/notifications/clear, non-existing link cards for statuses will
now return empty hash instead of throwing a 404 error. When following,
merge into timeline will filter statuses
Diffstat (limited to 'app/controllers/api/v1/notifications_controller.rb')
-rw-r--r--app/controllers/api/v1/notifications_controller.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/app/controllers/api/v1/notifications_controller.rb b/app/controllers/api/v1/notifications_controller.rb
index 3fd701997..ee12446d8 100644
--- a/app/controllers/api/v1/notifications_controller.rb
+++ b/app/controllers/api/v1/notifications_controller.rb
@@ -24,4 +24,9 @@ class Api::V1::NotificationsController < ApiController
   def show
     @notification = Notification.where(account: current_account).find(params[:id])
   end
+
+  def clear
+    Notification.where(account: current_account).delete_all
+    render_empty
+  end
 end