Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
lpil committed Nov 13, 2023
1 parent 490caa3 commit 60981bc
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/packages/index.gleam
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,11 @@ pub fn search_packages(
// In future it would be good to build more sophisticated queries, but for now
// we just escape it to avoid syntax errors.
fn webquery_to_sqlite_fts_query(webquery: String) -> String {
"\"" <> string.replace(webquery, "\"", "\"\"") <> "\""
let webquery = string.trim(webquery)
case webquery {
"" -> ""
_ -> "\"" <> string.replace(webquery, "\"", "\"\"") <> "\""
}
}

fn unix_timestamp(data: Dynamic) -> Result(DateTime, List(DecodeError)) {
Expand Down

0 comments on commit 60981bc

Please sign in to comment.