Formatting was done.
This commit is contained in:
1 parent
e9e509ab04
commit
11212c7371
2 files changed
+5
-5
No files matched your search
@@ -9,7 +9,7 @@ const CreateMonitorHeader = ({ isAdmin, label, isLoading = true, path, bulkPath
|
||||
const navigate = useNavigate();
|
||||
const { t } = useTranslation();
|
||||
const theme = useTheme();
|
||||
const [exportMonitors, isExporting] = useExportMonitors()
|
||||
const [exportMonitors, isExporting] = useExportMonitors();
|
||||
|
||||
// Use the provided label or fall back to the translated default
|
||||
|
||||
|
||||
@@ -464,19 +464,19 @@ const useExportMonitors = () => {
|
||||
|
||||
// Create a download link
|
||||
const url = window.URL.createObjectURL(blob);
|
||||
const link = document.createElement('a');
|
||||
const link = document.createElement("a");
|
||||
link.href = url;
|
||||
link.setAttribute('download', 'monitors.csv');
|
||||
link.setAttribute("download", "monitors.csv");
|
||||
document.body.appendChild(link);
|
||||
link.click();
|
||||
link.remove();
|
||||
window.URL.revokeObjectURL(url);
|
||||
|
||||
createToast({ body: t('export.success') });
|
||||
createToast({ body: t("export.success") });
|
||||
return [true, null];
|
||||
} catch (err) {
|
||||
const errorMessage = err?.response?.data?.msg || err.message;
|
||||
createToast({ body: errorMessage || t('export.failed') });
|
||||
createToast({ body: errorMessage || t("export.failed") });
|
||||
return [false, errorMessage];
|
||||
} finally {
|
||||
setIsLoading(false);
|
||||
|
||||
Reference in new issue
Block a user