Class: Renalware::Messaging::Internal::ReceiptsController

Inherits:
BaseController show all
Includes:
PresenterHelper, Concerns::Pageable
Defined in:
app/controllers/renalware/messaging/internal/receipts_controller.rb

Instance Method Summary collapse

Methods included from PresenterHelper

#present

Methods inherited from BaseController

#patient

Instance Method Details

#mark_as_readObject

PATCH



30
31
32
33
34
35
36
# File 'app/controllers/renalware/messaging/internal/receipts_controller.rb', line 30

def mark_as_read
  authorize receipt
  receipt.update(read_at: Time.zone.now)
  render locals: {
    receipt: ReceiptPresenter.new(receipt)
  }
end

#readObject

GET all read messages



20
21
22
# File 'app/controllers/renalware/messaging/internal/receipts_controller.rb', line 20

def read
  render_receipts(read_receipts)
end

#sentObject

GET all sent messages



25
26
27
# File 'app/controllers/renalware/messaging/internal/receipts_controller.rb', line 25

def sent
  render_receipts(sent_receipts)
end

#unreadObject

GET aka inbox



15
16
17
# File 'app/controllers/renalware/messaging/internal/receipts_controller.rb', line 15

def unread
  render_receipts(unread_receipts)
end