From 734597739aa61a870d5f90c1d0785229f8c45b6a Mon Sep 17 00:00:00 2001 From: PARK BYUNG JUN Date: Sat, 13 Aug 2022 03:57:45 +0000 Subject: [PATCH] bug fixed --- src/repositories/member_class/repository.rs | 8 ++++---- src/repositories/member_level/repository.rs | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) 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() {