Adding controller actions and routes for pausing and unpausing a standing order

This commit is contained in:
Rob Harrington
2016-12-07 16:34:27 +11:00
parent 961df756c5
commit 8ff9ffbc38
5 changed files with 109 additions and 3 deletions

View File

@@ -50,6 +50,16 @@ module Admin
end
end
def pause
@standing_order.update_attributes(paused_at: Time.zone.now)
render_as_json @standing_order, fee_calculator: fee_calculator
end
def unpause
@standing_order.update_attributes(paused_at: nil)
render_as_json @standing_order, fee_calculator: fee_calculator
end
private
def permissions