Manos Chorianopoulos

ContextualViewController submitOrder optimizations

......@@ -202,7 +202,8 @@ import SwiftEventBus
case .default:
self.navigationController?.popViewController(animated: true)
swiftApi().getCouponsAsync(getCouponsCallback, failureCallback: {errorCode in })
// swiftApi().getCouponsAsync(getCouponsCallback, failureCallback: {errorCode in })
swiftApi().getCouponsAsyncInternal(getCouponsCallback, failureCallback: {errorCode in })
func getCouponsCallback (_ couponsData: Array<swiftApi.CouponItemModel>?) -> Void {
if (couponsData != nil) {
......@@ -213,7 +214,24 @@ import SwiftEventBus
}
}
swiftApi().getCampaignsAsyncNew(language: "en", filters: [String : Any](), getCampaignsCallback, failureCallback: {errorCode in })
var campaignFound: swiftApi.CampaignItemModel? = nil
if let ccmLoyaltyCampaignId = self.ccms?._loyaltyCampaignId {
let allCampaigns = swiftApi().getAllCampaignList()
for item in allCampaigns {
if (item.session_uuid == ccmLoyaltyCampaignId) {
campaignFound = item
break;
}
}
}
if let tempCampaign = campaignFound {
swiftApi().removeCampaignItem(campaignArg: tempCampaign)
swiftApi().getCampaignsAsyncNewInternal(getCampaignsCallback, failureCallback: {errorCode in})
}
// swiftApi().getCampaignsAsyncNew(language: "en", filters: [String : Any](), getCampaignsCallback, failureCallback: {errorCode in })
func getCampaignsCallback (_ campaignsData: Array<swiftApi.CampaignItemModel>?) -> Void {
if (campaignsData != nil) {
......