Manos Chorianopoulos

fix getCouponsAsync, getCampaignsAsync callbacks

......@@ -397,7 +397,9 @@ public class swiftApi {
// On CouponSets request Success, match coupons with couponsets
let tempCoupons = matchCoupons()
swiftApi().setCouponList(tempCoupons)
getCouponsCallback(tempCoupons)
let activeCoupons = coupons.filter({ return $0.status == 1 })
getCouponsCallback(activeCoupons)
}
func couponSetsFailureCallback(_ error: Error?) -> Void {
......@@ -700,7 +702,14 @@ public class swiftApi {
}
swiftApi().setUniqueCampaignList(campaignsArray)
getCampaignsCallback(campaignsArray);
let filteredCampaigns = campaignsArray.filter {
let tempCampaign = $0
let isCcmsOffer = (tempCampaign.ccms_offer != nil) && (tempCampaign.ccms_offer != "") && (tempCampaign.ccms_offer == "true")
return (!isCcmsOffer)
}
getCampaignsCallback(filteredCampaigns);
}
func campaignsFailureCallback(_ error: Error?) -> Void {
......