From ca75319f20fcc53c00599481865c4c686df0cc94 Mon Sep 17 00:00:00 2001 From: PARK BYUNG JUN Date: Tue, 30 Aug 2022 09:14:07 +0000 Subject: [PATCH] bug fixed --- src/api/member_account/api.rs | 2 +- src/api/member_account/models.rs | 2 +- src/compositions/member/models.rs | 2 +- src/repositories/member/models.rs | 4 ++-- src/repositories/member/schema.rs | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/api/member_account/api.rs b/src/api/member_account/api.rs index df86b28..f23c427 100644 --- a/src/api/member_account/api.rs +++ b/src/api/member_account/api.rs @@ -69,7 +69,7 @@ impl Api { let balance = r.balance.unwrap_or(0.00); let balance_bota = r.balance_bota.unwrap_or(0.00); let balance_sum = r.balance_sum.unwrap_or(0.00); - let companies = r.companies.unwrap_or("".to_string()); + let companies = r.companies; Ok(models::GetBalanceForUserResponse { balance, diff --git a/src/api/member_account/models.rs b/src/api/member_account/models.rs index 57172fc..22c5681 100644 --- a/src/api/member_account/models.rs +++ b/src/api/member_account/models.rs @@ -23,7 +23,7 @@ pub struct GetBalanceForUserResponse { pub balance_bota: f64, #[serde(rename = "balanceSum")] pub balance_sum: f64, - pub companies: String, + pub companies: Option, } pub struct GetBalanceForPartnerRequest {} diff --git a/src/compositions/member/models.rs b/src/compositions/member/models.rs index 8be6a88..00c3c69 100644 --- a/src/compositions/member/models.rs +++ b/src/compositions/member/models.rs @@ -12,7 +12,7 @@ pub struct MemberModel { /// pub balance_sum: f64, /// - pub companies: String, + pub companies: Option, /// pub oriental_play: String, /// diff --git a/src/repositories/member/models.rs b/src/repositories/member/models.rs index 752c721..c5a183d 100644 --- a/src/repositories/member/models.rs +++ b/src/repositories/member/models.rs @@ -14,7 +14,7 @@ pub struct Member { /// pub balance_sum: f64, /// - pub companies: String, + pub companies: Option, /// pub oriental_play: String, /// @@ -58,7 +58,7 @@ pub struct ModifyMemberForBalance { /// pub balance_sum: f64, /// - pub companies: String, + pub companies: Option, } /// diff --git a/src/repositories/member/schema.rs b/src/repositories/member/schema.rs index a6f0c77..5089b36 100644 --- a/src/repositories/member/schema.rs +++ b/src/repositories/member/schema.rs @@ -13,7 +13,7 @@ table! { /// balance_sum -> Double, /// - companies -> Text, + companies -> Nullable, /// oriental_play -> Text, ///