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