new card for roadworthiness, link to sims portal, bettwe error handling
Some checks failed
Deploy static content to Pages / deploy (push) Has been cancelled
Some checks failed
Deploy static content to Pages / deploy (push) Has been cancelled
This commit is contained in:
10
app.js
10
app.js
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user