1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-12-10 21:24:20 +01:00
fab-manager/app/controllers/api/notifications_controller.rb

13 lines
416 B
Ruby
Raw Normal View History

2015-05-05 03:10:25 +02:00
class API::NotificationsController < API::ApiController
include NotifyWith::NotificationsApi
before_action :authenticate_user!
def index
if params[:is_read]
2016-03-23 18:39:41 +01:00
@notifications = current_user.notifications.where(is_read: params[:is_read] == 'true').page(params[:page]).per(15).order('created_at DESC')
2015-05-05 03:10:25 +02:00
else
@notifications = current_user.notifications.order('created_at DESC')
end
end
end