From af1177e814d19e63ce39c42fc7c5888e4b3d9604 Mon Sep 17 00:00:00 2001 From: Joris Date: Sat, 9 Oct 2021 10:27:45 +0200 Subject: Search by category --- src/controller/payments.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/controller') diff --git a/src/controller/payments.rs b/src/controller/payments.rs index ab4bd92..883f9e1 100644 --- a/src/controller/payments.rs +++ b/src/controller/payments.rs @@ -22,6 +22,7 @@ pub async fn table( let payments = db::payments::list_for_table(&wallet.pool, &query, PER_PAGE).await; let max_page = (count.count as f32 / PER_PAGE as f32).ceil() as i64; + let categories = db::categories::list(&wallet.pool).await; let mut context = Context::new(); context.insert("header", &templates::Header::Payments); @@ -32,6 +33,7 @@ pub async fn table( context.insert("query", &query); context.insert("count", &count.count); context.insert("total_cost", &count.total_cost); + context.insert("categories", &categories); utils::template( &wallet.assets, @@ -99,6 +101,7 @@ pub async fn create( search: None, frequency: Some(create_payment.frequency), highlight: Some(id), + category: None, }; utils::redirect(&format!( "/{}", @@ -178,6 +181,7 @@ pub async fn update( search: None, frequency: Some(frequency), highlight: Some(id), + category: None, }; utils::redirect(&format!("/{}", queries::payments_url(query))) } else { -- cgit v1.2.3