diff --git a/app/assets/javascripts/admin/customers/controllers/customers_controller.js.coffee b/app/assets/javascripts/admin/customers/controllers/customers_controller.js.coffee index 769cec1c18..9e956a1977 100644 --- a/app/assets/javascripts/admin/customers/controllers/customers_controller.js.coffee +++ b/app/assets/javascripts/admin/customers/controllers/customers_controller.js.coffee @@ -4,7 +4,6 @@ angular.module("admin.customers").controller "customersCtrl", ($scope, $q, $filt $scope.RequestMonitor = RequestMonitor $scope.submitAll = pendingChanges.submitAll $scope.add = Customers.add - $scope.deleteCustomer = Customers.remove $scope.customerLimit = 20 $scope.columns = Columns.columns @@ -21,6 +20,10 @@ angular.module("admin.customers").controller "customersCtrl", ($scope, $q, $filt $scope.shop_id = shops[0].id if shops.length == 1 + $scope.deleteCustomer = (customer) -> + if confirm(t('admin.customers.index.confirm_delete')) + Customers.remove(customer) + $scope.checkForDuplicateCodes = -> delete this.customer.code unless this.customer.code this.duplicate = $scope.isDuplicateCode(this.customer.code) diff --git a/config/locales/en.yml b/config/locales/en.yml index f5f186e76c..ba2b1acab6 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -129,6 +129,7 @@ en: select_state: 'Select State' edit: 'Edit' update_address: 'Update Address' + confirm_delete: 'Sure to delete?' products: bulk_edit: