diff --git a/server/Cargo.lock b/server/Cargo.lock index 6edd0cb..211aa2f 100644 --- a/server/Cargo.lock +++ b/server/Cargo.lock @@ -2340,7 +2340,7 @@ dependencies = [ [[package]] name = "server" -version = "1.1.1" +version = "1.1.2" dependencies = [ "anyhow", "async_zip", diff --git a/server/Cargo.toml b/server/Cargo.toml index 54c3e19..417417f 100644 --- a/server/Cargo.toml +++ b/server/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "server" -version = "1.1.1" +version = "1.1.2" edition = "2021" [dependencies] diff --git a/server/src/db.rs b/server/src/db.rs index e5ec11a..7077c64 100644 --- a/server/src/db.rs +++ b/server/src/db.rs @@ -502,7 +502,10 @@ fn add_tag_matches(qb: &mut QueryBuilder, value: &str) { let push_taxonomy_sql = |qb: &mut QueryBuilder, tag_type: TagType, value: String| { qb.push(get_sql(&tag_type, "name")) .push_bind(value.clone()) - .push(format!("\n ) OR\n {condition} (\n ")) + .push(format!( + "\n ) {condition_op}\n {condition} (\n ", + condition_op = if negate { "AND" } else { "OR" } + )) .push(get_sql(&tag_type, "slug")) .push_bind(value) .push("\n )\n )\n".to_string()); @@ -513,7 +516,10 @@ fn add_tag_matches(qb: &mut QueryBuilder, value: &str) { qb.push(get_sql(&tag_type, "name")) .push_bind(value.clone()) .push(format!(" AND namespace ILIKE '{namespace}'")) - .push(format!("\n ) OR\n {condition} (\n ")) + .push(format!( + "\n ) {condition_op}\n {condition} (\n ", + condition_op = if negate { "AND" } else { "OR" } + )) .push(get_sql(&tag_type, "slug")) .push_bind(value) .push(format!(" AND namespace ILIKE '{namespace}'")) diff --git a/web/package.json b/web/package.json index b915f45..844a21e 100644 --- a/web/package.json +++ b/web/package.json @@ -1,6 +1,6 @@ { "name": "web-kit", - "version": "1.1.1", + "version": "1.1.2", "private": true, "scripts": { "dev": "vite dev",