This commit is contained in:
Gwenhael Le Moine 2017-11-24 16:12:18 +01:00
parent 106cae75fb
commit 1151b44ee3
No known key found for this signature in database
GPG key ID: FDFE3669426707A7

View file

@ -35,9 +35,7 @@ end
get "/api/ledger/balance" do |env| get "/api/ledger/balance" do |env|
env.response.content_type = "application/json" env.response.content_type = "application/json"
cleared = env.params.query.has_key?( "cleared" ) ? env.params.query[ "cleared" ] == "true" : false ledger.balance( env.params.query.has_key?( "cleared" ) ? env.params.query[ "cleared" ] == "true" : false,
ledger.balance( cleared,
env.params.query[ "depth" ].to_i, env.params.query[ "depth" ].to_i,
env.params.query[ "period" ], env.params.query[ "period" ],
env.params.query[ "categories" ] ) env.params.query[ "categories" ] )
@ -47,7 +45,8 @@ end
get "/api/ledger/graph_values" do |env| get "/api/ledger/graph_values" do |env|
env.response.content_type = "application/json" env.response.content_type = "application/json"
ledger.graph_values( env.params.query["period"], env.params.query["categories"].split(" ") ).to_json ledger.graph_values( env.params.query["period"],
env.params.query["categories"].split(" ") ).to_json
end end
get "/api/ledger/register" do |env| get "/api/ledger/register" do |env|