new card for roadworthiness, link to sims portal, bettwe error handling
Some checks failed
Deploy static content to Pages / deploy (push) Has been cancelled

This commit is contained in:
2026-03-22 01:56:55 +05:00
parent 167fe10bb2
commit 9e4014f295
3 changed files with 75 additions and 35 deletions

10
app.js
View File

@@ -309,8 +309,14 @@ async function setupPdfImport() {
try {
const text = await extractTextFromPdf(file);
const data = parseRegistrationData(text);
fillFormWithData(data);
showSnackbar('Data imported successfully!', 'success');
// Check if any data was extracted
if (Object.keys(data).length === 0) {
showSnackbar('Failed to import data. Make sure PDF was exported from SIMS portal.', 'error');
} else {
fillFormWithData(data);
showSnackbar('Data imported successfully!', 'success');
}
} catch (error) {
console.error('PDF import failed:', error);
showSnackbar('Failed to import PDF', 'error');