mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-11 03:40:20 +00:00
Catch JS error on OC page
Calling `when variant.id in enterprise_rules` raised an error when enterprise_rules was null. Fixing this then revealed a missing require statement in a controller.
This commit is contained in:
@@ -1,3 +1,7 @@
|
||||
angular.module("admin.orderCycles").filter "visibleVariants", ->
|
||||
return (variants, exchange, rules) ->
|
||||
return (variant for variant in variants when variant.id in rules[exchange.enterprise_id])
|
||||
enterprise_rules = rules[exchange.enterprise_id]
|
||||
if enterprise_rules
|
||||
(variant for variant in variants when variant.id in enterprise_rules)
|
||||
else
|
||||
[]
|
||||
|
||||
Reference in New Issue
Block a user