wasn't using the proper serializer causing frontend error
This commit is contained in:
parent
216a19476b
commit
8695297a0f
1 changed files with 5 additions and 2 deletions
|
@ -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
|
||||
if notifications.length > 0
|
||||
render json: notifications
|
||||
else
|
||||
render json: [].to_json
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue