Fixed the errors coming out in csv.

This commit is contained in:
Owaise Imdad committed 2025-05-01 12:05:28 +05:30
1 parent ecce31ce34
commit 075559ffc3
3 files changed
+52 -28

No files matched your search

+5 -3
View File
@@ -26,20 +26,22 @@ const BulkImport = () => {
{ name: t("bulkImport.title"), path: `/uptime/bulk-import` },
];
const [createBulkMonitors, hookLoading, error] = useBulkMonitors();
const [createBulkMonitors, hookLoading] = useBulkMonitors();
const handleSubmit = async () => {
if (!selectedFile) {
createToast({ body: t("bulkImport.noFileSelected") });
return;
}
const success = await createBulkMonitors(selectedFile, user);
const [success, data, error] = await createBulkMonitors(selectedFile, user);
if (success) {
// You can use `data` here if needed
createToast({ body: t("bulkImport.uploadSuccess") });
navigate("/uptime");
} else {
createToast({ body: error });
createToast({ body: error || t("bulkImport.uploadFailed") });
}
};