mirror of
https://github.com/gwenhael-le-moine/ledgerrb.git
synced 2024-12-26 09:59:18 +01:00
refine params
This commit is contained in:
parent
39b7f6128d
commit
b61021f4b9
1 changed files with 2 additions and 2 deletions
4
app.rb
4
app.rb
|
@ -22,19 +22,19 @@ class LedgerRbApp < Sinatra::Base
|
|||
|
||||
get '/api/ledger/accounts/depth/:depth' do
|
||||
content_type :json
|
||||
param :depth, Integer
|
||||
param :depth, Integer, required: true
|
||||
|
||||
Ledger.accounts( params[ :depth ] ).to_json
|
||||
end
|
||||
|
||||
get '/api/ledger/monthly/?' do
|
||||
content_type :json
|
||||
param :categories, Array
|
||||
|
||||
params[ :categories ].map do |category|
|
||||
{ category: category,
|
||||
data: Ledger.monthly_register( category ).to_json }
|
||||
end
|
||||
param :categories, Array, default: Ledger.accounts( 1 )
|
||||
end
|
||||
|
||||
get '/api/ledger/version/?' do
|
||||
|
|
Loading…
Reference in a new issue