Manos Chorianopoulos

refresh active coupons after activation

......@@ -58,6 +58,22 @@ import SwiftEventBus
} else if (eventArray[1] == "couponRetrieved") {
let couponEvent = swiftApi.CouponEventModel()
SwiftEventBus.post("coupon_retrieved", sender: couponEvent)
swiftApi().getCouponsAsync(getCouponsCallback)
func getCouponsCallback (_ couponsData: Array<swiftApi.CouponItemModel>?) -> Void {
if (couponsData != nil) {
DispatchQueue.main.async {
print("========= getCouponsRequest SUCCESSSS CampaignVC =========")
print("========= getCouponsRequest count CampaignVC =========")
print(swiftApi().getCouponList().count)
}
} else {
print("========= getCouponsRequest ERROR CampaignVC =========")
}
}
} else if (eventArray[1] == "couponShared") {
......