mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-01-01 13:13:22 +08:00
23 lines
609 B
Ruby
23 lines
609 B
Ruby
module ClientApi
|
|
class NotificationsController < ApplicationController
|
|
before_action :last_notifications, only: :recent_notifications
|
|
|
|
def recent_notifications
|
|
respond_to do |format|
|
|
format.json do
|
|
render template: '/client_api/notifications/index',
|
|
status: :ok,
|
|
locals: { notifications: @recent_notifications }
|
|
end
|
|
end
|
|
end
|
|
|
|
private
|
|
|
|
def last_notifications
|
|
@recent_notifications =
|
|
UserNotification.recent_notifications(current_user)
|
|
UserNotification.seen_by_user(current_user)
|
|
end
|
|
end
|
|
end
|