mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Don't send non-attributes of js order_cycle object to server
This commit is contained in:
@@ -139,6 +139,7 @@ angular.module('admin.order_cycles').factory('OrderCycle', ($resource, $window)
|
||||
|
||||
dataForSubmit: ->
|
||||
data = this.deepCopy()
|
||||
data = this.stripNonSubmittableAttributes(data)
|
||||
data = this.removeInactiveExchanges(data)
|
||||
data = this.translateCoordinatorFees(data)
|
||||
data = this.translateExchangeFees(data)
|
||||
@@ -159,6 +160,11 @@ angular.module('admin.order_cycles').factory('OrderCycle', ($resource, $window)
|
||||
|
||||
data
|
||||
|
||||
stripNonSubmittableAttributes: (order_cycle) ->
|
||||
delete order_cycle.id
|
||||
delete order_cycle.visible_variants_for_outgoing_exchanges
|
||||
order_cycle
|
||||
|
||||
removeInactiveExchanges: (order_cycle) ->
|
||||
order_cycle.incoming_exchanges =
|
||||
(exchange for exchange in order_cycle.incoming_exchanges when exchange.active)
|
||||
|
||||
Reference in New Issue
Block a user