From 8695297a0fa38e676e5d255d6c7cf75cca3c36cb Mon Sep 17 00:00:00 2001 From: Connor Turland Date: Fri, 29 Sep 2017 13:06:19 -0400 Subject: [PATCH] wasn't using the proper serializer causing frontend error --- app/controllers/notifications_controller.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/controllers/notifications_controller.rb b/app/controllers/notifications_controller.rb index 15781a32..cdbfb2ab 100644 --- a/app/controllers/notifications_controller.rb +++ b/app/controllers/notifications_controller.rb @@ -6,7 +6,6 @@ class NotificationsController < ApplicationController def index @notifications = current_user.mailbox.notifications.page(params[:page]).per(25) - respond_to do |format| format.html format.json do @@ -14,7 +13,11 @@ class NotificationsController < ApplicationController receipt = @receipts.find_by(notification_id: notification.id) NotificationDecorator.decorate(notification, receipt) end - render json: notifications + if notifications.length > 0 + render json: notifications + else + render json: [].to_json + end end end end