Manos Chorianopoulos

shared coupons refreshed at CouponsVC, WalletVC

...@@ -36,8 +36,15 @@ import SwiftEventBus ...@@ -36,8 +36,15 @@ import SwiftEventBus
36 tableView.contentInset.top = 50 36 tableView.contentInset.top = 50
37 } 37 }
38 38
39 + public override func viewWillAppear(_ animated: Bool) {
40 + super.viewWillAppear(animated)
41 +
42 + self.coupons = swiftApi().getCouponList()
43 + self.tableView.reloadData()
44 +
45 + }
39 46
40 - 47 +
41 // MARK: - API Functions 48 // MARK: - API Functions
42 func getCouponsRequest() { 49 func getCouponsRequest() {
43 swiftApi().getCouponsAsync(getCouponsCallback) 50 swiftApi().getCouponsAsync(getCouponsCallback)
......
...@@ -191,18 +191,16 @@ import UIKit ...@@ -191,18 +191,16 @@ import UIKit
191 if (response?.getStatus == 1) { 191 if (response?.getStatus == 1) {
192 self.showDialog("Συγχαρητήρια!","Μόλις έκανες δώρο ένα κουπόνι!") 192 self.showDialog("Συγχαρητήρια!","Μόλις έκανες δώρο ένα κουπόνι!")
193 193
194 -// swiftApi().getCouponsAsync(getCouponsCallback) 194 + swiftApi().getCouponsAsync(getCouponsCallback)
195 -// 195 +
196 -// func getCouponsCallback (_ couponsData: Array<swiftApi.CouponItemModel>?) -> Void { 196 + func getCouponsCallback (_ couponsData: Array<swiftApi.CouponItemModel>?) -> Void {
197 -// if (couponsData != nil) { 197 + if (couponsData != nil) {
198 -// 198 +
199 -// DispatchQueue.main.async { 199 + DispatchQueue.main.async {
200 -// print("========= getCouponsRequest SUCCESSSS CouponViewController =========") 200 + }
201 -// } 201 + } else {
202 -// } else { 202 + }
203 -// print("========= getCouponsRequest ERROR CouponViewController =========") 203 + }
204 -// }
205 -// }
206 } else { 204 } else {
207 self.showDialog("Αποτυχία","Κάτι πήγε στραβά") 205 self.showDialog("Αποτυχία","Κάτι πήγε στραβά")
208 } 206 }
......
...@@ -316,6 +316,9 @@ import SwiftEventBus ...@@ -316,6 +316,9 @@ import SwiftEventBus
316 } 316 }
317 questionnaireButton.layer.cornerRadius = 7.0 317 questionnaireButton.layer.cornerRadius = 7.0
318 } 318 }
319 +
320 + self.coupons = swiftApi().getCouponList()
321 + self.tableView.reloadData()
319 } 322 }
320 323
321 public override func viewDidLayoutSubviews() { 324 public override func viewDidLayoutSubviews() {
...@@ -362,6 +365,7 @@ import SwiftEventBus ...@@ -362,6 +365,7 @@ import SwiftEventBus
362 } 365 }
363 366
364 @IBAction func dfyEarnButtonAction(_ sender: Any) { 367 @IBAction func dfyEarnButtonAction(_ sender: Any) {
368 + print("DFY coupon banner pressed!")
365 // analysis_pressed event 369 // analysis_pressed event
366 let dealsAnalysis = swiftApi.WarplyDealsAnalysisEventModel() 370 let dealsAnalysis = swiftApi.WarplyDealsAnalysisEventModel()
367 dealsAnalysis._isPressed = true 371 dealsAnalysis._isPressed = true
......