add filter for money moves query
This commit is contained in:
@@ -1,6 +1,12 @@
|
||||
class MoneyMovesController < ApplicationController
|
||||
def index
|
||||
json_response(MoneyMove.find(:all).order(:created_at))
|
||||
if params[:homie_id]
|
||||
money_moves = MoneyMove.where(homie_id: params[:homie_id].to_i).all.order(created_at: :desc)
|
||||
else
|
||||
money_moves = MoneyMove.all.order(created_at: :desc)
|
||||
end
|
||||
|
||||
json_response money_moves
|
||||
end
|
||||
|
||||
def create
|
||||
|
||||
Reference in New Issue
Block a user