Class: Motor::RemindersController

Inherits:
ApiBaseController show all
Defined in:
app/controllers/motor/reminders_controller.rb

Instance Method Summary collapse

Methods included from CurrentAbility

#current_ability

Methods included from CurrentUserMethod

#current_user

Instance Method Details

#createObject



9
10
11
12
13
14
15
# File 'app/controllers/motor/reminders_controller.rb', line 9

def create
  @reminder.update!(author: current_user, recipient: current_user)

  broadcast_note_update(@reminder.record)

  render json: { data: Motor::ApiQuery::BuildJson.call(@reminder, params, current_ability) }
end

#destroyObject



17
18
19
20
21
22
23
# File 'app/controllers/motor/reminders_controller.rb', line 17

def destroy
  @reminder.destroy!

  broadcast_note_update(@reminder.record)

  head :ok
end