Skip to content

Commit

Permalink
trim searches
Browse files Browse the repository at this point in the history
  • Loading branch information
berinaniesh committed Nov 29, 2024
1 parent 34d4e27 commit 410426a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/routes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -418,15 +418,15 @@ pub async fn search(
} else {
qb.push("~* ");
}
let actual_search_string = format!(r#"\m{}\M"#, &search_parameters.search_text);
let actual_search_string = format!(r#"\m{}\M"#, &search_parameters.search_text.trim());
qb.push_bind(actual_search_string);
} else {
if match_case {
qb.push("like ");
} else {
qb.push("ilike ");
}
let actual_search_string = format!("%{}%", &search_parameters.search_text);
let actual_search_string = format!("%{}%", &search_parameters.search_text.trim());
qb.push_bind(actual_search_string);
}
qb.push(" and translation=");
Expand Down

0 comments on commit 410426a

Please sign in to comment.