mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-30 21:27:17 +00:00
SO Index: User must select a shop first in order to load relevant standing orders
This commit is contained in:
@@ -1,3 +1,9 @@
|
||||
angular.module("admin.standingOrders").controller "StandingOrdersController", ($scope, StandingOrders, Columns) ->
|
||||
$scope.standingOrders = StandingOrders.index({ams_prefix: 'index'}) # {enterprise_id: $scope.shop_id}
|
||||
angular.module("admin.standingOrders").controller "StandingOrdersController", ($scope, StandingOrders, Columns, shops) ->
|
||||
$scope.columns = Columns.columns
|
||||
$scope.shops = shops
|
||||
$scope.shop_id = if shops.length == 1 then shops[0].id else null
|
||||
|
||||
$scope.$watch "shop_id", ->
|
||||
if $scope.shop_id?
|
||||
# CurrentShop.shop = $filter('filter')($scope.shops, {id: $scope.shop_id})[0]
|
||||
$scope.standingOrders = StandingOrders.index("q[shop_id_eq]": $scope.shop_id, ams_prefix: 'index')
|
||||
|
||||
Reference in New Issue
Block a user