mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-10 23:07:47 +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
|
||||
[]
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'open_food_network/order_cycle_permissions'
|
||||
|
||||
module Admin
|
||||
class EnterpriseFeesController < Admin::ResourceController
|
||||
before_action :load_enterprise_fee_set, only: :index
|
||||
|
||||
Reference in New Issue
Block a user