]> cat aescling's git repositories - mastodon.git/commitdiff
Method to fetch a single notification
authorEugen Rochko <eugen@zeonfederated.com>
Sat, 21 Jan 2017 21:14:13 +0000 (22:14 +0100)
committerEugen Rochko <eugen@zeonfederated.com>
Sat, 21 Jan 2017 21:14:13 +0000 (22:14 +0100)
app/controllers/api/v1/notifications_controller.rb
config/routes.rb

index c8f162cb02e2329c6f4184cb00a11ed43b01da56..3fd7019976a6905024501a1abd76b08ce5fb498c 100644 (file)
@@ -20,4 +20,8 @@ class Api::V1::NotificationsController < ApiController
 
     set_pagination_headers(next_path, prev_path)
   end
+
+  def show
+    @notification = Notification.where(account: current_account).find(params[:id])
+  end
 end
index 4606c663a1be3d6d5b57b5f076aa0cbeb70df2ed..349ab336a0c6e0b763de7f7de3aa427f5e01b9fe 100644 (file)
@@ -114,7 +114,7 @@ Rails.application.routes.draw do
         end
       end
 
-      resources :notifications, only: [:index]
+      resources :notifications, only: [:index, :show]
       resources :favourites,    only: [:index]
 
       resources :accounts, only: [:show] do