Optimized code for the ajax request for the delete feature ajax process

This commit is contained in:
vishalsingh.qlo325
2024-05-21 09:41:54 +05:30
parent 3c17768cd3
commit ff24e26fe2
2 changed files with 4 additions and 4 deletions

View File

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

View File

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