Trying to use the DB (not working)

This commit is contained in:
Clayzxr
2025-01-18 23:38:29 +01:00
parent 30ffc90b69
commit 4057bb488c
5 changed files with 33 additions and 115 deletions
@@ -18,7 +18,7 @@ export default function UploadStudents() {
}
};
const handleUpload = async () => {
const handleUpload = () => {
if (!fileData.value) {
statusMessage.value = "Please select a file before confirming upload.";
return;
@@ -39,13 +39,19 @@ export default function UploadStudents() {
});
console.log(`Data from sheet ${sheetName}:`, data);
await insertIntoMobility(data as Array<{ firstName: string; lastName: string; email: string }>, sheetName);
await insertIntoMobility(
data as Array<
{ firstName: string; lastName: string; email: string }
>,
sheetName,
);
}
statusMessage.value = "File uploaded and data inserted successfully!";
} catch (error) {
console.error("Error reading or inserting file:", error);
statusMessage.value = "Error processing the file. Please check its format.";
statusMessage.value =
"Error processing the file. Please check its format.";
}
};