mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-11 03:40:20 +00:00
In the order cycle pages (both create and edit, both simple and normal), add OC coordinator to schedules request to the server and make the controller filter schedules of order cycles coordinated by that enterprise id.
This commit is contained in:
@@ -31,7 +31,11 @@ module Admin
|
||||
|
||||
def collection
|
||||
return Schedule.where("1=0") unless json_request?
|
||||
permissions.visible_schedules
|
||||
if params[:enterprise_id]
|
||||
permissions.visible_schedules.select { |schedule| schedule.coordinators.map(&:id).include? params[:enterprise_id].to_i }
|
||||
else
|
||||
permissions.visible_schedules
|
||||
end
|
||||
end
|
||||
|
||||
def collection_actions
|
||||
|
||||
Reference in New Issue
Block a user