mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-13 04:00:21 +00:00
Dumping OrderCycle data via :javascript tags instead of ng-init, Angularising the selector stuff
This commit is contained in:
@@ -1,9 +1,7 @@
|
||||
Shop.factory 'OrderCycle', ($resource, Product) ->
|
||||
Shop.factory 'OrderCycle', ($resource, Product, orderCycleData) ->
|
||||
class OrderCycle
|
||||
@order_cycle = {
|
||||
order_cycle_id: null
|
||||
}
|
||||
|
||||
@order_cycle = orderCycleData
|
||||
@push_order_cycle: ->
|
||||
new $resource("/shop/order_cycle").save {order_cycle_id: @order_cycle.order_cycle_id}, ->
|
||||
new $resource("/shop/order_cycle").save {order_cycle_id: @order_cycle.order_cycle_id}, (order_data)->
|
||||
OrderCycle.order_cycle.orders_close_at = order_data.orders_close_at
|
||||
Product.update()
|
||||
|
||||
Reference in New Issue
Block a user