Add confirm when delete customer

This commit is contained in:
Bing Xie
2016-09-01 11:50:27 +10:00
parent a94a30f422
commit 63617f80c5
2 changed files with 5 additions and 1 deletions

View File

@@ -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)

View File

@@ -129,6 +129,7 @@ en:
select_state: 'Select State'
edit: 'Edit'
update_address: 'Update Address'
confirm_delete: 'Sure to delete?'
products:
bulk_edit: