diff options
Diffstat (limited to 'src/routes.rs')
| -rw-r--r-- | src/routes.rs | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/src/routes.rs b/src/routes.rs index 8abe1b4..3afc822 100644 --- a/src/routes.rs +++ b/src/routes.rs @@ -86,6 +86,7 @@ async fn authenticated_routes( let query = uri.query(); match (method, path) { + // PAYMENTS (&Method::GET, [""]) => { controller::payments::table(&wallet, parse_query(query)).await } @@ -129,6 +130,7 @@ async fn authenticated_routes( ) .await } + // INCOMES (&Method::GET, ["incomes"]) => { controller::incomes::table(&wallet, parse_query(query)).await } @@ -168,6 +170,7 @@ async fn authenticated_routes( ) .await } + // CATEGORIES (&Method::GET, ["categories"]) => { controller::categories::table(&wallet, parse_query(query)).await } @@ -192,13 +195,57 @@ async fn authenticated_routes( (&Method::POST, ["category", id, "delete"]) => { controller::categories::delete(parse_id(id), &wallet).await } + // BALANCING + (&Method::GET, ["balancings"]) => { + controller::balancing::table(&wallet, parse_query(query)).await + } + (&Method::GET, ["balancing"]) => { + controller::balancing::create_form(&wallet, parse_query(query)).await + } + (&Method::POST, ["balancing", "create"]) => { + controller::balancing::create( + &wallet, + parse_query(query), + body_form(request).await, + ) + .await + } + (&Method::GET, ["balancing", id]) => { + controller::balancing::update_form( + parse_id(id), + &wallet, + parse_query(query), + ) + .await + } + (&Method::POST, ["balancing", id, "update"]) => { + controller::balancing::update( + parse_id(id), + &wallet, + parse_query(query), + body_form(request).await, + ) + .await + } + (&Method::POST, ["balancing", id, "delete"]) => { + controller::balancing::delete( + parse_id(id), + &wallet, + parse_query(query), + ) + .await + } + // BALANCE (&Method::GET, ["balance"]) => controller::balance::get(&wallet).await, + // STATS (&Method::GET, ["statistics"]) => { controller::statistics::get(&wallet).await } + // LOGOUT (&Method::POST, ["logout"]) => { controller::login::logout(config, &wallet).await } + // ERROR _ => controller::error::error( &wallet, "Page introuvable", |
