diff --git a/app/Views/shared/script_validation.php b/app/Views/shared/script_validation.php index 1163075..c547085 100644 --- a/app/Views/shared/script_validation.php +++ b/app/Views/shared/script_validation.php @@ -251,16 +251,19 @@ document.addEventListener('alpine:init', () => { }).then(response => response.json()).then(data => { console.log(data); if (data.val === 2) { - this.showToast(`Validated (val2): ${data.accessnumber} - PDF queued`); + this.showToast(`Validated (val2): ${accessnumber} - PDF queued`); // Trigger PDF auto-generation after val2 - fetch(`${BASEURL}/report/${data.accessnumber}/pdf`).then(res => res.json()).then(pdfData => { + fetch(`${BASEURL}/report/${accessnumber}/pdf`).then(res => res.json()).then(pdfData => { if (pdfData.success) { console.log('PDF generation queued:', pdfData.jobId); + this.showToast(`${pdfData.lang} PDF queued for generation`, 'success'); } else { console.error('PDF generation failed:', pdfData.error); + this.showToast('PDF generation failed', 'error'); } }).catch(err => { console.error('PDF generation request failed:', err); + this.showToast('PDF generation failed', 'error'); }); } else { this.showToast(`Validated: ${accessnumber}`);