aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJoris2021-10-10 18:20:57 +0200
committerJoris2021-10-10 21:21:34 +0200
commit8ccd762bfc3d7da2716749d709cf5cc216882a23 (patch)
tree0629f749da8b06698e760b275070ba6a2e8bde0c /src
parentaf1177e814d19e63ce39c42fc7c5888e4b3d9604 (diff)
downloadbudget-8ccd762bfc3d7da2716749d709cf5cc216882a23.tar.gz
budget-8ccd762bfc3d7da2716749d709cf5cc216882a23.tar.bz2
budget-8ccd762bfc3d7da2716749d709cf5cc216882a23.zip
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.
Diffstat (limited to 'src')
-rw-r--r--src/db/payments.rs5
1 files changed, 1 insertions, 4 deletions
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::<Vec<String>>()
@@ -165,7 +163,6 @@ fn bind_search<'a, Row: FromRow<'a, SqliteRow>>(
.bind(s.clone())
.bind(s.clone())
.bind(s.clone())
- .bind(s.clone())
})
}