1
0
forked from baron/baron-sso

feat: implement user data CSV export with dynamic metadata columns

This commit is contained in:
2026-03-04 15:54:11 +09:00
parent c126634e16
commit 9720b77898
5 changed files with 125 additions and 2 deletions

View File

@@ -3,6 +3,7 @@ import type { AxiosError } from "axios";
import {
ChevronLeft,
ChevronRight,
FileDown,
Pencil,
Plus,
RefreshCw,
@@ -48,6 +49,7 @@ import {
fetchTenant,
fetchTenants,
fetchUsers,
exportUsersCSVUrl,
} from "../../lib/adminApi";
import { t } from "../../lib/i18n";
import { UserBulkUploadModal } from "./components/UserBulkUploadModal";
@@ -149,6 +151,11 @@ function UserListPage() {
}
};
const handleExport = () => {
const url = exportUsersCSVUrl(search, selectedCompany);
window.open(url, "_blank");
};
const errorMsg = (query.error as AxiosError<{ error?: string }>)?.response
?.data?.error;
const fallbackError =
@@ -252,6 +259,10 @@ function UserListPage() {
<RefreshCw size={16} />
{t("ui.common.refresh", "새로고침")}
</Button>
<Button variant="outline" onClick={handleExport} className="gap-2">
<FileDown size={16} />
{t("ui.common.export", "내보내기")}
</Button>
<UserBulkUploadModal onSuccess={() => query.refetch()} />
<Dialog>
<DialogTrigger asChild>