Sha256: fd302db68f68926a91e61585c678314a2a390d6b5038a774193f1de415aeccc6

Contents?: true

Size: 614 Bytes

Versions: 4

Compression:

Stored size: 614 Bytes

Contents

module Loco
  class NotificationCenterController < ApplicationController
    def index
      if Loco::Config.silence_logger
        logger.silence{ fetch_notifications }
      else
        fetch_notifications
      end
    end

    private

      def fetch_notifications
        opts = {
          synced_at: params[:synced_at],
          permissions: defined?(loco_permissions) ? loco_permissions : [],
          recipient_token: params[:token]
        }
        fetcher = Notification::Fetcher.new opts
        render json: [fetcher.formatted_notifications, fetcher.next_sync_time.iso8601(6)]
      end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
loco-rails-1.0.2 app/controllers/loco/notification_center_controller.rb
loco-rails-1.0.1 app/controllers/loco/notification_center_controller.rb
loco-rails-1.0.0 app/controllers/loco/notification_center_controller.rb
loco-rails-0.0.1 app/controllers/loco/notification_center_controller.rb