mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-12 03:50:22 +00:00
Enterprise service splits enterprises into hubs and producers
This commit is contained in:
@@ -10,6 +10,8 @@ angular.module('admin.orderCycles').factory('Enterprise', ($resource) ->
|
||||
{
|
||||
Enterprise: Enterprise
|
||||
enterprises: {}
|
||||
producer_enterprises: []
|
||||
hub_enterprises: []
|
||||
supplied_products: []
|
||||
loaded: false
|
||||
|
||||
@@ -17,6 +19,8 @@ angular.module('admin.orderCycles').factory('Enterprise', ($resource) ->
|
||||
Enterprise.index params, (data) =>
|
||||
for enterprise in data
|
||||
@enterprises[enterprise.id] = enterprise
|
||||
@producer_enterprises.push(enterprise) if enterprise.is_primary_producer
|
||||
@hub_enterprises.push(enterprise) if enterprise.sells == 'any'
|
||||
|
||||
for product in enterprise.supplied_products
|
||||
@supplied_products.push(product)
|
||||
|
||||
Reference in New Issue
Block a user