mirror of
https://github.com/gwenhael-le-moine/credger.git
synced 2024-12-26 09:58:36 +01:00
format
This commit is contained in:
parent
106cae75fb
commit
1151b44ee3
1 changed files with 3 additions and 4 deletions
|
@ -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|
|
||||||
|
|
Loading…
Reference in a new issue