Manos Chorianopoulos

update MFYViewController

...@@ -12,7 +12,7 @@ import UIKit ...@@ -12,7 +12,7 @@ import UIKit
12 @IBOutlet weak var mainView: UIView! 12 @IBOutlet weak var mainView: UIView!
13 @IBOutlet weak var tableView: UITableView! 13 @IBOutlet weak var tableView: UITableView!
14 14
15 - public var campaigns:Array<swiftApi.CampaignItemModel> = [] 15 + public var campaigns:Array<swiftApi.CampaignItemModel> = swiftApi().mergeMFYCCMSLoyaltyCampaigns(campaigns: swiftApi().getCCMSLoyaltyCampaigns())
16 16
17 17
18 public override func viewDidLoad() { 18 public override func viewDidLoad() {
...@@ -20,8 +20,6 @@ import UIKit ...@@ -20,8 +20,6 @@ import UIKit
20 20
21 self.hidesBottomBarWhenPushed = true 21 self.hidesBottomBarWhenPushed = true
22 22
23 - getCampaignsRequest()
24 -
25 setBackButton() 23 setBackButton()
26 setNavigationTitle("MORE for YOU") 24 setNavigationTitle("MORE for YOU")
27 25
...@@ -41,24 +39,6 @@ import UIKit ...@@ -41,24 +39,6 @@ import UIKit
41 39
42 } 40 }
43 41
44 -
45 - func getCampaignsRequest() {
46 - swiftApi().getCampaignsAsync(getCampaignsCallback)
47 - }
48 -
49 - func getCampaignsCallback (_ campaignsData: Array<swiftApi.CampaignItemModel>?) -> Void {
50 - if (campaignsData != nil) {
51 -
52 - self.campaigns = campaignsData?.filter { $0.offer_category == "more_for_you" } ?? []
53 -
54 - DispatchQueue.main.async {
55 - self.tableView.reloadData()
56 - swiftApi().setUniqueCampaignList(campaignsData ?? [])
57 - }
58 - } else {
59 - self.campaigns = []
60 - }
61 - }
62 } 42 }
63 43
64 // MARK: - TableView 44 // MARK: - TableView
......