From 8ccd762bfc3d7da2716749d709cf5cc216882a23 Mon Sep 17 00:00:00 2001 From: Joris Date: Sun, 10 Oct 2021 18:20:57 +0200 Subject: Search payments by categories explicitely It was already possible to search by categories in the full text input, but it could have matched other fields as well. Explicitely add a select to search by categories. Also put the search form in a left aside. The mobile view is not done for the moment. --- src/db/payments.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'src') diff --git a/src/db/payments.rs b/src/db/payments.rs index 624ba9f..3b85dab 100644 --- a/src/db/payments.rs +++ b/src/db/payments.rs @@ -133,7 +133,6 @@ OFFSET ? fn search_query(search: String) -> String { let payments_name = utils::format_key_for_search("payments.name"); let users_name = utils::format_key_for_search("users.name"); - let categories_name = utils::format_key_for_search("categories.name"); search .split_ascii_whitespace() @@ -144,11 +143,10 @@ AND ( {} LIKE ? OR payments.cost LIKE ? OR {} LIKE ? - OR {} LIKE ? OR strftime('%d/%m/%Y', date) LIKE ? ) "#, - payments_name, users_name, categories_name + payments_name, users_name ) }) .collect::>() @@ -165,7 +163,6 @@ fn bind_search<'a, Row: FromRow<'a, SqliteRow>>( .bind(s.clone()) .bind(s.clone()) .bind(s.clone()) - .bind(s.clone()) }) } -- cgit v1.2.3