about summary refs log tree commit diff
path: root/app/controllers/api/v1/notifications_controller.rb
diff options
context:
space:
mode:
authorkibigo! <marrus-sh@users.noreply.github.com>2017-07-12 02:03:17 -0700
committerkibigo! <marrus-sh@users.noreply.github.com>2017-07-12 02:03:17 -0700
commit79d898ae0ad8c0e66bd63ec3e0904e9e5e7894e8 (patch)
treeee8d832ed2f11e9afe62daf0e586a86004eb8d98 /app/controllers/api/v1/notifications_controller.rb
parentbcf7ee48e94cd2e4d2de28e8854e7f0e2b5cad1f (diff)
parent056b5ed72f6d980bceeb49eb249b8365fe8fce66 (diff)
Merge upstream!! #64 <3 <3
Diffstat (limited to 'app/controllers/api/v1/notifications_controller.rb')
-rw-r--r--app/controllers/api/v1/notifications_controller.rb7
1 files changed, 2 insertions, 5 deletions
diff --git a/app/controllers/api/v1/notifications_controller.rb b/app/controllers/api/v1/notifications_controller.rb
index a28e99f2f..8910b77e9 100644
--- a/app/controllers/api/v1/notifications_controller.rb
+++ b/app/controllers/api/v1/notifications_controller.rb
@@ -11,11 +11,12 @@ class Api::V1::NotificationsController < Api::BaseController
 
   def index
     @notifications = load_notifications
-    set_maps_for_notification_target_statuses
+    render json: @notifications, each_serializer: REST::NotificationSerializer, relationships: StatusRelationshipsPresenter.new(target_statuses_from_notifications, current_user&.account_id)
   end
 
   def show
     @notification = current_account.notifications.find(params[:id])
+    render json: @notification, serializer: REST::NotificationSerializer
   end
 
   def clear
@@ -46,10 +47,6 @@ class Api::V1::NotificationsController < Api::BaseController
     current_account.notifications.browserable(exclude_types)
   end
 
-  def set_maps_for_notification_target_statuses
-    set_maps target_statuses_from_notifications
-  end
-
   def target_statuses_from_notifications
     @notifications.reject { |notification| notification.target_status.nil? }.map(&:target_status)
   end