accept and use custom settle value
This commit is contained in:
@@ -28,9 +28,10 @@ class HomiesController < ApplicationController
|
||||
|
||||
def settle
|
||||
homie_id = params[:homie_id].to_i
|
||||
amount = params[:amount].present? ? params[:amount].to_d : nil
|
||||
homie = Homie.find(homie_id)
|
||||
|
||||
if homie.settle
|
||||
if homie.settle(amount)
|
||||
json_response []
|
||||
else
|
||||
error_response :bad_request
|
||||
|
||||
Reference in New Issue
Block a user