Optimized code for the ajax request for the delete feature ajax process
This commit is contained in:
@@ -292,10 +292,10 @@ class AdminHotelFeaturesController extends ModuleAdminController
|
||||
if ($objHotelFeatures->deleteHotelFeatures($idFeature)) {
|
||||
$response['status'] = true;
|
||||
} else {
|
||||
$response['msg'] = $this->l('Some error occurred while deleting feature. Please try again.', null, true);
|
||||
$response['msg'] = $this->l('Some error occurred while deleting feature. Please try again.');
|
||||
}
|
||||
} else {
|
||||
$response['msg'] = $this->l('You do not have the permission to delete this.', null, true);
|
||||
$response['msg'] = $this->l('You do not have the permission to delete this.');
|
||||
}
|
||||
|
||||
$this->ajaxDie(json_encode($response));
|
||||
|
||||
@@ -463,8 +463,8 @@ $(document).ready(function() {
|
||||
action: 'deleteFeature',
|
||||
},
|
||||
method: 'POST',
|
||||
success: function(data) {
|
||||
var response = JSON.parse(data);
|
||||
dataType: 'json',
|
||||
success: function(response) {
|
||||
if (response.status) {
|
||||
alert(success_delete_msg);
|
||||
$('#grand_feature_div_' + ftr_id).remove();
|
||||
|
||||
Reference in New Issue
Block a user