handle settling records for homie
This commit is contained in:
@@ -26,6 +26,19 @@ class HomiesController < ApplicationController
|
||||
json_response(Homie.cash(importance))
|
||||
end
|
||||
|
||||
def settle
|
||||
homie_id = params[:homy_id].to_i
|
||||
homie = Homie.find(homie_id)
|
||||
|
||||
if homie.settle
|
||||
json_response []
|
||||
else
|
||||
error_response :bad_request
|
||||
end
|
||||
rescue StandardError
|
||||
error_response :bad_request
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def homie_params
|
||||
|
||||
Reference in New Issue
Block a user