From 016f77a2c923642a47ddbb0a5f5cde74f08ea068 Mon Sep 17 00:00:00 2001 From: Finley Ghosh Date: Sun, 7 Dec 2025 18:08:35 +1100 Subject: [PATCH] Streamlining quote reminder logging --- go/internal/cmc/handlers/quotes/quotes.go | 11 ----------- go/templates/quotes/index.html | 3 --- 2 files changed, 14 deletions(-) diff --git a/go/internal/cmc/handlers/quotes/quotes.go b/go/internal/cmc/handlers/quotes/quotes.go index c377abc7..6a783f3a 100644 --- a/go/internal/cmc/handlers/quotes/quotes.go +++ b/go/internal/cmc/handlers/quotes/quotes.go @@ -589,8 +589,6 @@ func (h *QuotesHandler) SendQuoteReminderEmailWithAttachment(ctx context.Context // SendManualReminder handles POST requests to manually send a quote reminder func (h *QuotesHandler) SendManualReminder(w http.ResponseWriter, r *http.Request) { - log.Printf("SendManualReminder handler called") - if r.Method != http.MethodPost { http.Error(w, "Method not allowed", http.StatusMethodNotAllowed) return @@ -657,7 +655,6 @@ func (h *QuotesHandler) SendManualReminder(w http.ResponseWriter, r *http.Reques // Attach PDF quote from URL pdfURL := fmt.Sprintf("https://stg.cmctechnologies.com.au/pdf/%s.pdf", enquiryRef) pdfFilename := fmt.Sprintf("%s.pdf", enquiryRef) - log.Printf("Manual reminder for quote %d (%s): recipient=%s, pdfURL=%s", quoteID, enquiryRef, customerEmail, pdfURL) // Get username from request username := getUsername(r) @@ -685,8 +682,6 @@ func (h *QuotesHandler) SendManualReminder(w http.ResponseWriter, r *http.Reques return } - log.Printf("Manual reminder sent successfully for quote %d (%s) to %s", quoteID, enquiryRef, customerEmail) - // Check if this is an AJAX request if r.Header.Get("X-Requested-With") == "XMLHttpRequest" { w.Header().Set("Content-Type", "application/json") @@ -710,13 +705,11 @@ func (h *QuotesHandler) DisableReminders(w http.ResponseWriter, r *http.Request) // Parse form data if err := r.ParseForm(); err != nil { - log.Printf("Failed to parse form for disable reminders: %v", err) http.Error(w, "Invalid form data", http.StatusBadRequest) return } quoteIDStr := r.FormValue("quote_id") - log.Printf("DisableReminders: received quote_id='%s', all form values: %v", quoteIDStr, r.Form) if quoteIDStr == "" { http.Error(w, "Missing quote_id", http.StatusBadRequest) return @@ -743,8 +736,6 @@ func (h *QuotesHandler) DisableReminders(w http.ResponseWriter, r *http.Request) return } - log.Printf("Reminders disabled for quote %d by %s", quoteID, username) - // Check if this is an AJAX request if r.Header.Get("X-Requested-With") == "XMLHttpRequest" { w.Header().Set("Content-Type", "application/json") @@ -793,8 +784,6 @@ func (h *QuotesHandler) EnableReminders(w http.ResponseWriter, r *http.Request) return } - log.Printf("Reminders enabled for quote %d", quoteID) - // Check if this is an AJAX request if r.Header.Get("X-Requested-With") == "XMLHttpRequest" { w.Header().Set("Content-Type", "application/json") diff --git a/go/templates/quotes/index.html b/go/templates/quotes/index.html index 906a1431..f47551c5 100644 --- a/go/templates/quotes/index.html +++ b/go/templates/quotes/index.html @@ -339,7 +339,6 @@ function hideConfirmModal() { } function showDisableModal(quoteID, enquiryRef) { - console.log('showDisableModal called with:', quoteID, enquiryRef); currentQuoteID = quoteID; document.getElementById('disableModalQuoteID').textContent = quoteID; document.getElementById('disableModalEnquiryRef').textContent = enquiryRef; @@ -421,11 +420,9 @@ document.getElementById('modalConfirmBtn').addEventListener('click', async funct document.getElementById('disableModalCancelBtn').addEventListener('click', hideDisableModal); document.getElementById('disableModalConfirmBtn').addEventListener('click', async function() { - console.log('Disable confirm clicked, currentQuoteID:', currentQuoteID); if (currentQuoteID) { const formData = new URLSearchParams(); formData.append('quote_id', currentQuoteID); - console.log('FormData quote_id:', formData.get('quote_id')); try { const response = await fetch('/go/quotes/disable-reminders', {