Fix state_id and country_id type bug

This commit is contained in:
Bing Xie
2016-09-08 15:40:50 +10:00
parent 2f241485a2
commit e91c313f1e
2 changed files with 11 additions and 2 deletions

View File

@@ -1,4 +1,13 @@
Darkswarm.factory 'CurrentOrder', (currentOrder) ->
# Populate Currentorder.order from json in page. This is probably redundant now.
new class CurrentOrder
order: currentOrder
constructor: ->
if currentOrder.bill_address
currentOrder.bill_address.state_id = currentOrder.bill_address.state_id + ''
currentOrder.bill_address.country_id = currentOrder.bill_address.country_id + ''
if currentOrder.ship_address
currentOrder.ship_address.state_id = currentOrder.ship_address.state_id + ''
currentOrder.ship_address.country_id = currentOrder.ship_address.country_id + ''
@order = currentOrder