Manos Chorianopoulos

refactor getCampaignList, add getAllCampaignList

......@@ -2236,9 +2236,24 @@ public class swiftApi {
GlobalVariables.campaigns = campaignsArray
}
public func getCampaignList() -> Array<CampaignItemModel> {
let filteredCampaigns = GlobalVariables.campaigns.filter {
let tempCampaign = $0
let isCcmsOffer = (tempCampaign.ccms_offer != nil) && (tempCampaign.ccms_offer != "") && (tempCampaign.ccms_offer == "true")
return (!isCcmsOffer)
}
print("getCampaignList:{" + String(filteredCampaigns.count) + "} campaigns")
return filteredCampaigns
}
public func getAllCampaignList() -> Array<CampaignItemModel> {
return GlobalVariables.campaigns
}
......@@ -2364,7 +2379,7 @@ public class swiftApi {
GlobalVariables.loyaltyBadge = loyaltyBadge
}
public func getCouponList() -> Array<CouponItemModel> {
return GlobalVariables.couponList
}
......