Class: Cats::Core::NotificationsController
  
  
  
  
    
      Instance Method Summary
      collapse
    
    
  
  
  
  
  
  
  
  
  
  
  #authenticate, #current_user, #skip_bullet
  
  
    Instance Method Details
    
      
  
  
    #index  ⇒ Object 
  
  
  
  
    
      
6
7
8
9 
     | 
    
      # File 'app/controllers/cats/core/notifications_controller.rb', line 6
def index
  data = Notification.messages(current_user.notifications.newest_first)
  render json: {success: true, data: data}
end
     | 
  
 
    
      
  
  
    #mark_as_read  ⇒ Object 
  
  
  
  
    
      
21
22
23
24 
     | 
    
      # File 'app/controllers/cats/core/notifications_controller.rb', line 21
def mark_as_read
  @notification.mark_as_read!
  render json: {success: true, data: @notification.message}
end
     | 
  
 
    
      
  
  
    #mark_as_unread  ⇒ Object 
  
  
  
  
    
      
26
27
28
29 
     | 
    
      # File 'app/controllers/cats/core/notifications_controller.rb', line 26
def mark_as_unread
  @notification.mark_as_unread!
  render json: {success: true, data: @notification.message}
end
     | 
  
 
    
      
  
  
    #read  ⇒ Object 
  
  
  
  
    
      
11
12
13
14 
     | 
    
      # File 'app/controllers/cats/core/notifications_controller.rb', line 11
def read
  data = Notification.messages(current_user.notifications.read.newest_first)
  render json: {success: true, data: data}
end
     | 
  
 
    
      
  
  
    #unread  ⇒ Object 
  
  
  
  
    
      
16
17
18
19 
     | 
    
      # File 'app/controllers/cats/core/notifications_controller.rb', line 16
def unread
  data = Notification.messages(current_user.notifications.unread.newest_first)
  render json: {success: true, data: data}
end
     |