1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-02-17 11:54:22 +01:00
fab-manager/app/controllers/api/wallet_controller.rb
2016-07-21 16:32:54 +02:00

21 lines
480 B
Ruby

class API::WalletController < API::ApiController
before_action :authenticate_user!
def my
@wallet = current_user.wallet
render :show
end
def by_user
authorize Wallet
@wallet = Wallet.find_by(user_id: params[:user_id])
render :show
end
def transactions
@wallet = Wallet.find(params[:id])
authorize @wallet
@wallet_transactions = @wallet.wallet_transactions.includes(:transactable, user: [:profile]).order(created_at: :desc)
end
end