aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/db/payments.rs2
-rw-r--r--src/utils/text.rs2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/db/payments.rs b/src/db/payments.rs
index f20dbdc..0082736 100644
--- a/src/db/payments.rs
+++ b/src/db/payments.rs
@@ -484,7 +484,7 @@ ORDER BY
);
let res = sqlx::query(&query)
- .bind(text::format_search(&format!("%{}%", payment_name)))
+ .bind(text::format_search(&payment_name))
.map(|row: SqliteRow| row.get("category_id"))
.fetch_one(pool)
.await;
diff --git a/src/utils/text.rs b/src/utils/text.rs
index c07ccee..3a6f495 100644
--- a/src/utils/text.rs
+++ b/src/utils/text.rs
@@ -1,5 +1,5 @@
pub fn format_search(str: &String) -> String {
- unaccent(&str.to_lowercase())
+ format!("%{}%", unaccent(&str.to_lowercase()))
}
pub fn unaccent(str: &String) -> String {