From 17c8f1558fcca740dfb53c4833aee2b8b601c541 Mon Sep 17 00:00:00 2001 From: "venkatesh.r" Date: Sat, 30 Mar 2024 18:44:54 +0530 Subject: [PATCH] FIX_KYC_AND_POLICY_MASTER_REDIRECT : RV --- app/Views/kyc_docs.php | 4 +- app/Views/policies.php | 86 +++++++++++++++++++++--------------------- 2 files changed, 47 insertions(+), 43 deletions(-) diff --git a/app/Views/kyc_docs.php b/app/Views/kyc_docs.php index 0ec33c05..6567df7c 100644 --- a/app/Views/kyc_docs.php +++ b/app/Views/kyc_docs.php @@ -324,6 +324,7 @@ $(document).ready(function () { function removeKYCDocs(element) { + var kyc_docs_id_for_reload = $('#kyc_type_id').val(); var id = element.getAttribute('data-id'); var form_action = '' + id; $.ajax({ @@ -338,7 +339,8 @@ $(document).ready(function () { if (res.status == true) { toastr.success('Remove Done!', 'success'); - location.reload(); + // location.reload(); + window.location.href = '' + kyc_docs_id_for_reload; } else { toastr.warning('Remove Not Done!', 'warning'); diff --git a/app/Views/policies.php b/app/Views/policies.php index 83560c37..6ae8f361 100644 --- a/app/Views/policies.php +++ b/app/Views/policies.php @@ -340,57 +340,58 @@ $(document).ready(function () { function loadPoliciesList() { var base_url = ''; - var insurer_branch_action = base_url + policy_type_PrimaryKey; + var insurer_branch_action = base_url + policy_type_PrimaryKey; - if ($('#policy_type_id').val() != '') { - - $('.loader').fadeIn(); - $('.loader-mask').fadeIn(); - $.ajax({ - url: insurer_branch_action, - type: 'GET', - success: function(response) { + if ($('#policy_type_id').val() != '') { + + $('.loader').fadeIn(); + $('.loader-mask').fadeIn(); + $.ajax({ + url: insurer_branch_action, + type: 'GET', + success: function(response) { - console.log("response", response); + console.log("response", response); - setTimeout(function() { - $('.loader').fadeOut(); - $('.loader-mask').delay(350).fadeOut('slow'); - }, 1000); - var branchTable = ''; - $.each(response.policies, function(index, item) { - console.log(item); - branchTable += ` - - ${item.insurer.name} - ${item.policy.name} - - - - - - `; - }); - $('#policies_list').append(branchTable); - }, - error: function(xhr, status, error) { - console.error(xhr.responseText); - console.error(status, error); + setTimeout(function() { + $('.loader').fadeOut(); + $('.loader-mask').delay(350).fadeOut('slow'); + }, 1000); + var branchTable = ''; + $.each(response.policies, function(index, item) { + console.log(item); + branchTable += ` + + ${item.insurer.name} + ${item.policy.name} + + + + + + `; + }); + $('#policies_list').append(branchTable); + }, + error: function(xhr, status, error) { + console.error(xhr.responseText); + console.error(status, error); - setTimeout(function() { - $('.loader').fadeOut(); - $('.loader-mask').delay(350).fadeOut('slow'); - toastr.warning('Something Wrong!', 'warning'); - }, 1000); - } - }); - } + setTimeout(function() { + $('.loader').fadeOut(); + $('.loader-mask').delay(350).fadeOut('slow'); + toastr.warning('Something Wrong!', 'warning'); + }, 1000); + } + }); + } } }); function removePolicies(element) { + var policy_id_for_reload = $('#policy_type_id').val() var id = element.getAttribute('data-id'); var form_action = '' + id; $.ajax({ @@ -407,7 +408,8 @@ function removePolicies(element) { // $('#branch_table').empty(); - location.reload(); + // location.reload(); + window.location.href = '' + policy_id_for_reload; } else { toastr.warning('Remove Not Done!', 'warning');