diff --git a/app/Views/sales/activity_view.php b/app/Views/sales/activity_view.php index 4679c381..8a4be769 100644 --- a/app/Views/sales/activity_view.php +++ b/app/Views/sales/activity_view.php @@ -461,6 +461,7 @@ function closeModal(id) { selectedType = 'Call'; $('#typeButtons .d_activity_type').removeClass('active'); $('#typeButtons .d_activity_type[data-type="Call"]').addClass('active'); + fetchActivities(); // now i called because of Refresh the page ....... } // Specific cleanup for "Complete" modal (hidden follow-up sections) @@ -652,7 +653,6 @@ async function fetchActivities(isLoadMore = false) { // 2. Detail Logic async function viewDetail(id) { - console.log("i am here"); lead_id = id; let res = await fetch(`${API}/leads/${id}`); let json = await res.json(); @@ -740,6 +740,7 @@ function renderCard(opps) { function renderTimeline(acts) { const cont = document.getElementById('timelineContainer'); + if (acts.length === 0) { cont.classList.add('no-line'); @@ -786,6 +787,7 @@ function renderTimeline(acts) { } function openActivityModal() { + document.getElementById('act_owner').value = global_lead_assigned_to; document.getElementById('act_owner').dispatchEvent(new Event('change')); document.getElementById('act_lead_id').value = lead_id; @@ -908,7 +910,7 @@ document.getElementById('activityForm').onsubmit = async (e) => { toastr.success('Activity Created Successfully'); closeModal('activityModal'); if (flag === "frompopup") { - viewDetail(document.getElementById('act_lead_id').value); + viewDetail(actLead); } else { window.location.reload(); } diff --git a/app/Views/sales/tracker_view.php b/app/Views/sales/tracker_view.php index 98936f85..4dabe1ae 100644 --- a/app/Views/sales/tracker_view.php +++ b/app/Views/sales/tracker_view.php @@ -1607,7 +1607,7 @@ if (btnSaveContact) { body: JSON.stringify(payload) }); - const result = await res.json(); // Get the response body + const contactResult = await res.json(); // Get the response body if (res.ok) { // Clear inputs @@ -1620,16 +1620,16 @@ if (btnSaveContact) { // Create the HTML string let contactHtml = ` -