cartodb/app/controllers/helpers/organization_notifications_helper.rb
2020-06-15 10:58:47 +08:00

8 lines
320 B
Ruby

module OrganizationNotificationsHelper
def load_organization_notifications
carto_user = Carto::User.where(id: current_user.id).first if current_user
@organization_notifications = carto_user ? carto_user.received_notifications.unread.map { |n| Carto::Api::ReceivedNotificationPresenter.new(n) } : {}
end
end