Manos Chorianopoulos

shared coupons refreshed at CouponsVC, WalletVC

......@@ -36,8 +36,15 @@ import SwiftEventBus
tableView.contentInset.top = 50
}
public override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
self.coupons = swiftApi().getCouponList()
self.tableView.reloadData()
}
// MARK: - API Functions
func getCouponsRequest() {
swiftApi().getCouponsAsync(getCouponsCallback)
......
......@@ -191,18 +191,16 @@ import UIKit
if (response?.getStatus == 1) {
self.showDialog("Συγχαρητήρια!","Μόλις έκανες δώρο ένα κουπόνι!")
// swiftApi().getCouponsAsync(getCouponsCallback)
//
// func getCouponsCallback (_ couponsData: Array<swiftApi.CouponItemModel>?) -> Void {
// if (couponsData != nil) {
//
// DispatchQueue.main.async {
// print("========= getCouponsRequest SUCCESSSS CouponViewController =========")
// }
// } else {
// print("========= getCouponsRequest ERROR CouponViewController =========")
// }
// }
swiftApi().getCouponsAsync(getCouponsCallback)
func getCouponsCallback (_ couponsData: Array<swiftApi.CouponItemModel>?) -> Void {
if (couponsData != nil) {
DispatchQueue.main.async {
}
} else {
}
}
} else {
self.showDialog("Αποτυχία","Κάτι πήγε στραβά")
}
......
......@@ -316,6 +316,9 @@ import SwiftEventBus
}
questionnaireButton.layer.cornerRadius = 7.0
}
self.coupons = swiftApi().getCouponList()
self.tableView.reloadData()
}
public override func viewDidLayoutSubviews() {
......@@ -362,6 +365,7 @@ import SwiftEventBus
}
@IBAction func dfyEarnButtonAction(_ sender: Any) {
print("DFY coupon banner pressed!")
// analysis_pressed event
let dealsAnalysis = swiftApi.WarplyDealsAnalysisEventModel()
dealsAnalysis._isPressed = true
......