mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Make inject_current_order_cycle render {} instad of null if current_order_cycle is null
This commit is contained in:
@@ -62,7 +62,9 @@ module InjectionHelper
|
||||
end
|
||||
|
||||
def inject_current_order_cycle
|
||||
inject_json_ams "orderCycleData", current_order_cycle, Api::OrderCycleSerializer
|
||||
serializer = Api::OrderCycleSerializer.new(current_order_cycle)
|
||||
json = serializer.object.present? ? serializer.to_json : "{}"
|
||||
render partial: "json/injection_ams", locals: { name: "orderCycleData", json: json }
|
||||
end
|
||||
|
||||
def inject_available_shipping_methods
|
||||
|
||||
Reference in New Issue
Block a user