diff options
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/api/v1/notifications_controller.rb | 5 | ||||
-rw-r--r-- | app/controllers/api/v1/statuses_controller.rb | 3 |
2 files changed, 7 insertions, 1 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 diff --git a/app/controllers/api/v1/statuses_controller.rb b/app/controllers/api/v1/statuses_controller.rb index 37ed5e6dd..da87ebbad 100644 --- a/app/controllers/api/v1/statuses_controller.rb +++ b/app/controllers/api/v1/statuses_controller.rb @@ -22,7 +22,8 @@ class Api::V1::StatusesController < ApiController end def card - @card = PreviewCard.find_by!(status: @status) + @card = PreviewCard.find_by(status: @status) + render_empty if @card.nil? end def reblogged_by |