diff --git a/src/repositories/member_class/repository.rs b/src/repositories/member_class/repository.rs index d90c2a3..de5fb37 100644 --- a/src/repositories/member_class/repository.rs +++ b/src/repositories/member_class/repository.rs @@ -58,7 +58,7 @@ impl Repository { ) -> Result { let mut q = member_classes::table.into_boxed(); - if let Some(sp) = find_all.name_like { + if let Some(sp) = &find_all.name_like { q = q.filter(member_classes::dsl::name.like(sp)); } @@ -73,11 +73,11 @@ impl Repository { ) -> Result, Error> { let mut q = member_classes::table.into_boxed(); - if let Some(sp) = find_all.name_like { + if let Some(sp) = &find_all.name_like { q = q.filter(member_classes::dsl::name.like(sp)); } - if let Some(p) = find_all.pagination { + if let Some(p) = &find_all.pagination { let page = p.page.unwrap_or(1); if let Some(page_size) = p.page_size { @@ -85,7 +85,7 @@ impl Repository { q = q.limit(page_size as i64); } } - if let Some(orderbys) = find_all.sorts { + if let Some(orderbys) = &find_all.sorts { for s in orderbys { match s { bcr::models::pagination::Sort::ASC(property) => match property.as_str() { diff --git a/src/repositories/member_level/repository.rs b/src/repositories/member_level/repository.rs index 059ae19..4700de4 100644 --- a/src/repositories/member_level/repository.rs +++ b/src/repositories/member_level/repository.rs @@ -58,7 +58,7 @@ impl Repository { ) -> Result { let mut q = member_levels::table.into_boxed(); - if let Some(sp) = find_all.name_like { + if let Some(sp) = &find_all.name_like { q = q.filter(member_levels::dsl::name.like(sp)); } @@ -73,11 +73,11 @@ impl Repository { ) -> Result, Error> { let mut q = member_levels::table.into_boxed(); - if let Some(sp) = find_all.name_like { + if let Some(sp) = &find_all.name_like { q = q.filter(member_levels::dsl::name.like(sp)); } - if let Some(p) = find_all.pagination { + if let Some(p) = &find_all.pagination { let page = p.page.unwrap_or(1); if let Some(page_size) = p.page_size { @@ -85,7 +85,7 @@ impl Repository { q = q.limit(page_size as i64); } } - if let Some(orderbys) = find_all.sorts { + if let Some(orderbys) = &find_all.sorts { for s in orderbys { match s { bcr::models::pagination::Sort::ASC(property) => match property.as_str() {