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 navigate = useNavigate();
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
const [exportMonitors, isExporting] = useExportMonitors()
|
const [exportMonitors, isExporting] = useExportMonitors();
|
||||||
|
|
||||||
// Use the provided label or fall back to the translated default
|
// Use the provided label or fall back to the translated default
|
||||||
|
|
||||||
|
|||||||
@@ -464,19 +464,19 @@ const useExportMonitors = () => {
|
|||||||
|
|
||||||
// Create a download link
|
// Create a download link
|
||||||
const url = window.URL.createObjectURL(blob);
|
const url = window.URL.createObjectURL(blob);
|
||||||
const link = document.createElement('a');
|
const link = document.createElement("a");
|
||||||
link.href = url;
|
link.href = url;
|
||||||
link.setAttribute('download', 'monitors.csv');
|
link.setAttribute("download", "monitors.csv");
|
||||||
document.body.appendChild(link);
|
document.body.appendChild(link);
|
||||||
link.click();
|
link.click();
|
||||||
link.remove();
|
link.remove();
|
||||||
window.URL.revokeObjectURL(url);
|
window.URL.revokeObjectURL(url);
|
||||||
|
|
||||||
createToast({ body: t('export.success') });
|
createToast({ body: t("export.success") });
|
||||||
return [true, null];
|
return [true, null];
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
const errorMessage = err?.response?.data?.msg || err.message;
|
const errorMessage = err?.response?.data?.msg || err.message;
|
||||||
createToast({ body: errorMessage || t('export.failed') });
|
createToast({ body: errorMessage || t("export.failed") });
|
||||||
return [false, errorMessage];
|
return [false, errorMessage];
|
||||||
} finally {
|
} finally {
|
||||||
setIsLoading(false);
|
setIsLoading(false);
|
||||||
|
|||||||
Reference in new issue
Block a user