Sha256: c2a6559f0a3a40081872ef8f88e5b973d91e06f7104ab8c617887e0039c6ad81
Contents?: true
Size: 978 Bytes
Versions: 56
Compression:
Stored size: 978 Bytes
Contents
module Comee module Core class NotificationsController < ApplicationController before_action :set_notification, only: %i[mark_as_read mark_as_unread] def index data = Notification.messages(current_user.notifications.newest_first) render_content(data) end def read data = Notification.messages(current_user.notifications.read.newest_first) render_content(data) end def unread data = Notification.messages(current_user.notifications.unread.newest_first) render_content(data) end def mark_as_read @notification.mark_as_read! render json: {success: true, data: @notification.message} end def mark_as_unread @notification.mark_as_unread! render json: {success: true, data: @notification.message} end private def set_notification @notification = Notification.find(params[:id]) end end end end
Version data entries
56 entries across 56 versions & 1 rubygems