Manos Chorianopoulos

update MFYViewController

......@@ -12,7 +12,7 @@ import UIKit
@IBOutlet weak var mainView: UIView!
@IBOutlet weak var tableView: UITableView!
public var campaigns:Array<swiftApi.CampaignItemModel> = []
public var campaigns:Array<swiftApi.CampaignItemModel> = swiftApi().mergeMFYCCMSLoyaltyCampaigns(campaigns: swiftApi().getCCMSLoyaltyCampaigns())
public override func viewDidLoad() {
......@@ -20,8 +20,6 @@ import UIKit
self.hidesBottomBarWhenPushed = true
getCampaignsRequest()
setBackButton()
setNavigationTitle("MORE for YOU")
......@@ -41,24 +39,6 @@ import UIKit
}
func getCampaignsRequest() {
swiftApi().getCampaignsAsync(getCampaignsCallback)
}
func getCampaignsCallback (_ campaignsData: Array<swiftApi.CampaignItemModel>?) -> Void {
if (campaignsData != nil) {
self.campaigns = campaignsData?.filter { $0.offer_category == "more_for_you" } ?? []
DispatchQueue.main.async {
self.tableView.reloadData()
swiftApi().setUniqueCampaignList(campaignsData ?? [])
}
} else {
self.campaigns = []
}
}
}
// MARK: - TableView
......