aboutsummaryrefslogtreecommitdiff
path: root/src/controller
diff options
context:
space:
mode:
authorJoris2021-10-09 10:27:45 +0200
committerJoris2021-10-10 21:21:32 +0200
commitaf1177e814d19e63ce39c42fc7c5888e4b3d9604 (patch)
tree9e8d495f21a82e8cff92fe7692eb856b0e900e07 /src/controller
parenta370f989fe3b864676ed9aecf57f70e55e7958b2 (diff)
Search by category
Diffstat (limited to 'src/controller')
-rw-r--r--src/controller/payments.rs4
1 files changed, 4 insertions, 0 deletions
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 {