diff --git a/app/controllers/api/v1/accounts/notifications_controller.rb b/app/controllers/api/v1/accounts/notifications_controller.rb index 40ed65f5f..9d4bb1846 100644 --- a/app/controllers/api/v1/accounts/notifications_controller.rb +++ b/app/controllers/api/v1/accounts/notifications_controller.rb @@ -4,6 +4,7 @@ class Api::V1::Accounts::NotificationsController < Api::V1::Accounts::BaseContro before_action :fetch_notification, only: [:update, :destroy, :snooze] before_action :set_primary_actor, only: [:read_all] + before_action :set_current_page, only: [:index] def index @unread_count = current_user.notifications.where(account_id: current_account.id, read_at: nil).count @@ -56,6 +57,10 @@ class Api::V1::Accounts::NotificationsController < Api::V1::Accounts::BaseContro @notification = current_user.notifications.find(params[:id]) end + def set_current_page + @current_page = params[:page] || 1 + end + def notification_finder @notification_finder ||= NotificationFinder.new(Current.user, Current.account, params) end