bug fixed

This commit is contained in:
병준 박 2022-08-13 03:57:45 +00:00
parent ba825a641a
commit 734597739a
2 changed files with 8 additions and 8 deletions

View File

@ -58,7 +58,7 @@ impl Repository {
) -> Result<i64, Error> { ) -> Result<i64, Error> {
let mut q = member_classes::table.into_boxed(); 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)); q = q.filter(member_classes::dsl::name.like(sp));
} }
@ -73,11 +73,11 @@ impl Repository {
) -> Result<Vec<models::MemberClass>, Error> { ) -> Result<Vec<models::MemberClass>, Error> {
let mut q = member_classes::table.into_boxed(); 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)); 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); let page = p.page.unwrap_or(1);
if let Some(page_size) = p.page_size { if let Some(page_size) = p.page_size {
@ -85,7 +85,7 @@ impl Repository {
q = q.limit(page_size as i64); 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 { for s in orderbys {
match s { match s {
bcr::models::pagination::Sort::ASC(property) => match property.as_str() { bcr::models::pagination::Sort::ASC(property) => match property.as_str() {

View File

@ -58,7 +58,7 @@ impl Repository {
) -> Result<i64, Error> { ) -> Result<i64, Error> {
let mut q = member_levels::table.into_boxed(); 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)); q = q.filter(member_levels::dsl::name.like(sp));
} }
@ -73,11 +73,11 @@ impl Repository {
) -> Result<Vec<models::MemberLevel>, Error> { ) -> Result<Vec<models::MemberLevel>, Error> {
let mut q = member_levels::table.into_boxed(); 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)); 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); let page = p.page.unwrap_or(1);
if let Some(page_size) = p.page_size { if let Some(page_size) = p.page_size {
@ -85,7 +85,7 @@ impl Repository {
q = q.limit(page_size as i64); 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 { for s in orderbys {
match s { match s {
bcr::models::pagination::Sort::ASC(property) => match property.as_str() { bcr::models::pagination::Sort::ASC(property) => match property.as_str() {