From 0803995d93604d47aa8ec84875b229f7aa4bbbcc Mon Sep 17 00:00:00 2001 From: gme_2 Date: Sun, 2 Sep 2018 17:13:58 +0900 Subject: [PATCH] bug fixed --- GMERemittance/AppDelegate.swift | 2 +- .../Extension/UIViewControllerExtension.swift | 4 ---- GMERemittance/Model/User.swift | 20 +++++++------------ .../View/SendMoneyParentViewController.swift | 2 -- 4 files changed, 8 insertions(+), 20 deletions(-) diff --git a/GMERemittance/AppDelegate.swift b/GMERemittance/AppDelegate.swift index de91789e..e069a81e 100644 --- a/GMERemittance/AppDelegate.swift +++ b/GMERemittance/AppDelegate.swift @@ -240,7 +240,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD if (UserDefaults.standard.object(forKey: "com.gmeremit.loginStatus") as! Bool) { - guard (UserDefaults.standard.object(forKey: "com.gmeremit.isKYCSubmitted") as! Bool) else { + guard (UserDefaults.standard.object(forKey: UserKeys.kyc) as! Bool) == true else { let storyboard = UIStoryboard.init(name: "Main", bundle: Bundle.main) if let KYCPersonalInfoViewController = storyboard.instantiateViewController(withIdentifier: "KYCPersonalInfoViewController") as? KYCPersonalInfoViewController { diff --git a/GMERemittance/Extension/UIViewControllerExtension.swift b/GMERemittance/Extension/UIViewControllerExtension.swift index 48587c09..d4eb5c7c 100644 --- a/GMERemittance/Extension/UIViewControllerExtension.swift +++ b/GMERemittance/Extension/UIViewControllerExtension.swift @@ -9,10 +9,6 @@ import Foundation import UIKit import MBProgressHUD - - - - // ccr // MARK: Alerts diff --git a/GMERemittance/Model/User.swift b/GMERemittance/Model/User.swift index 663d603a..ece22c93 100644 --- a/GMERemittance/Model/User.swift +++ b/GMERemittance/Model/User.swift @@ -14,17 +14,11 @@ protocol Login: ApiServiceType { } extension Login { - func _login(userId: String, password: String ,success: @escaping (User?) -> (), failure: @escaping (Error) -> ()) { + func _login(userId: String, password: String, success: @escaping (User?) -> (), failure: @escaping (Error) -> ()) { let params = [ "userId": userId, "password": password ] let url = baseUrl + "users/access-code" - auth.request(method: .post, url: url, params: params, success: { (response: UserContainer ) in - if (response.errorCode ?? "") == "1" { - let error = NSError.init(domain: "Network", code: 0, userInfo: [NSLocalizedDescriptionKey : response.message ?? ""]) - failure(error) - }else { - let model = response.data - success(model) - } + auth.request(method: .post, url: url, params: params,needsAuthorization: false, success: { (response: User ) in + success(response) }) { (error) in failure(error) } @@ -97,12 +91,12 @@ class User: Mappable { var availableBalance: String? var accessCode: String? var dpUrl: String? - var kyc: String? - var verified: String? - var active: String? + var kyc: Bool? + var verified: Bool? + var active: Bool? var primaryBankName: String? var cmRegistrationId: String? - var isReferred: String? + var isReferred: Bool? var country: String? var province: String? var provinceId: String? diff --git a/GMERemittance/Module/SendMoneyParent/User Interface/View/SendMoneyParentViewController.swift b/GMERemittance/Module/SendMoneyParent/User Interface/View/SendMoneyParentViewController.swift index fa4bea9e..4e22dc47 100644 --- a/GMERemittance/Module/SendMoneyParent/User Interface/View/SendMoneyParentViewController.swift +++ b/GMERemittance/Module/SendMoneyParent/User Interface/View/SendMoneyParentViewController.swift @@ -89,8 +89,6 @@ class SendMoneyParentViewController: UIViewController { self.presenter?.viewIsReady() self.setupViewControllers() self.addPaymentModeViewController() - - } override func viewWillAppear(_ animated: Bool) {