1
Fork 0

core: Fix type mismatch

This commit is contained in:
Steffo 2024-11-16 07:49:12 +01:00
parent 5078b41499
commit 219880f3d3
Signed by: steffo
GPG key ID: 5ADA3868646C3FC0

View file

@ -72,13 +72,13 @@ pub struct MetaProperty {
} }
impl MetaSubject { impl MetaSubject {
pub async fn query_matching(conn: &mut AsyncPgConnection, doc: &str, subject: &str) -> QueryResult<Vec<Self>> { pub async fn query_matching(conn: &mut AsyncPgConnection, doc: &str, subject_: &str) -> QueryResult<Vec<Self>> {
use diesel::prelude::*; use diesel::prelude::*;
use diesel_async::RunQueryDsl; use diesel_async::RunQueryDsl;
use schema::meta_subjects::dsl::*; use schema::meta_subjects::dsl::*;
let document_is_equal = document.eq(doc); let document_is_equal = document.eq(doc);
let subject_matches_pattern = subject.into_sql::<diesel::sql_types::Text>().ilike(pattern); let subject_matches_pattern = subject_.into_sql::<diesel::sql_types::Text>().ilike(pattern);
meta_subjects meta_subjects
.filter(document_is_equal) .filter(document_is_equal)