Change type form is aware of existing state of enterprise

This commit is contained in:
Rob Harrington
2014-10-24 11:12:54 +11:00
parent 911d1e3dc4
commit 900ef4ddcc
2 changed files with 4 additions and 3 deletions

View File

@@ -1,7 +1,7 @@
angular.module("admin.enterprises")
.controller "changeTypeFormCtrl", ($scope) ->
$scope.sells = "unspecified"
$scope.producer_profile_only = true
.controller "changeTypeFormCtrl", ($scope, enterprise) ->
$scope.sells = enterprise.sells
$scope.producer_profile_only = enterprise.producer_profile_only
$scope.submitted = false
$scope.valid = (form) ->

View File

@@ -1,3 +1,4 @@
class Api::Admin::EnterpriseSerializer < ActiveModel::Serializer
attributes :name, :id, :is_primary_producer, :is_distributor, :sells, :category, :payment_method_ids, :shipping_method_ids
attributes :producer_profile_only
end