From 2d0ca6905a97ef4a065897880122521ab09c2571 Mon Sep 17 00:00:00 2001 From: Mumthasir mohammed Date: Thu, 29 Feb 2024 15:08:38 +0530 Subject: [PATCH] Fix #225: Contract DA text issue after onboarding. --- .../BBConsentOrganisationViewController.swift | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/PrivacyDashboardiOS/Classes/ViewControllers/DashBoardViewController/BBConsentOrganisationViewController.swift b/PrivacyDashboardiOS/Classes/ViewControllers/DashBoardViewController/BBConsentOrganisationViewController.swift index 89ef918..aa77e14 100644 --- a/PrivacyDashboardiOS/Classes/ViewControllers/DashBoardViewController/BBConsentOrganisationViewController.swift +++ b/PrivacyDashboardiOS/Classes/ViewControllers/DashBoardViewController/BBConsentOrganisationViewController.swift @@ -32,9 +32,10 @@ class BBConsentOrganisationViewController: BBConsentBaseViewController { override func viewDidLoad() { super.viewDidLoad() setupUI() + callDataAgreementsApi { _ in + self.callRecordsApi() + } callOrganisationApi() - callRecordsApi() - callDataAgreementsApi() } func setupUI(){ @@ -60,7 +61,7 @@ class BBConsentOrganisationViewController: BBConsentBaseViewController { self.navigationController?.navigationBar.isHidden = true if isNeedToRefresh == true{ isNeedToRefresh = false - callDataAgreementsApi() + callDataAgreementsApi { _ in } } } @@ -80,7 +81,7 @@ class BBConsentOrganisationViewController: BBConsentBaseViewController { } - func callDataAgreementsApi() { + func callDataAgreementsApi(completion: @escaping(Bool)-> Void) { let url = baseUrl + "/service/data-agreements?offset=0&limit=500" self.api.makeAPICall(urlString: url, method:.get) { status, result in if status { @@ -89,7 +90,7 @@ class BBConsentOrganisationViewController: BBConsentBaseViewController { let model = try? jsonDecoder.decode(DataAgreementsModel.self, from: data) debugPrint("### DataAgreements:\(String(describing: model))") self.dataAgreementsObj = model - self.orgTableView.reloadData() + completion(true) } } }