mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-10 23:07:47 +00:00
13 lines
675 B
CoffeeScript
13 lines
675 B
CoffeeScript
Admin.controller "AdminEnterpriseRelationshipsCtrl", ($scope, $http, EnterpriseRelationships, Enterprises) ->
|
|
$scope.EnterpriseRelationships = EnterpriseRelationships
|
|
$scope.Enterprises = Enterprises
|
|
|
|
$scope.create = ->
|
|
$http.post('/admin/enterprise_relationships', {enterprise_relationship: {parent_id: $scope.parent_id, child_id: $scope.child_id}}).success (data, status) =>
|
|
$scope.EnterpriseRelationships.enterprise_relationships.unshift({parent_name: data.parent_name, child_name: data.child_name})
|
|
|
|
.error (response, status) =>
|
|
#@errors = response.errors
|
|
#flash.error = response.flash?.error
|
|
#flash.success = response.flash?.notice
|