mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-01-04 06:36:27 +08:00
24 lines
609 B
Ruby
24 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
|