-
-
- {t("ui.dev.clients.general.footer.client_id", "Client ID")}
-
- {data?.client?.id}
-
-
-
- {t("ui.dev.clients.general.footer.created_on", "Created On")}
-
-
- {data?.client?.createdAt
- ? new Date(data.client.createdAt).toLocaleString()
- : "-"}
-
-
+
+
+ {!isCreate && (
+
+ )}
- )}
+
+
+
+
+
);
}
diff --git a/devfront/src/features/clients/ClientsPage.tsx b/devfront/src/features/clients/ClientsPage.tsx
index 7cd7ad2a..9d9def58 100644
--- a/devfront/src/features/clients/ClientsPage.tsx
+++ b/devfront/src/features/clients/ClientsPage.tsx
@@ -1,4 +1,4 @@
-import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
+import { useQuery } from "@tanstack/react-query";
import type { AxiosError } from "axios";
import {
BookOpenText,
@@ -22,10 +22,8 @@ import {
CardHeader,
CardTitle,
} from "../../components/ui/card";
-import { CopyButton } from "../../components/ui/copy-button";
import { Input } from "../../components/ui/input";
import { Separator } from "../../components/ui/separator";
-import { Switch } from "../../components/ui/switch";
import {
Table,
TableBody,
@@ -34,56 +32,16 @@ import {
TableHeader,
TableRow,
} from "../../components/ui/table";
-import { toast } from "../../components/ui/use-toast";
-import {
- deleteClient,
- fetchClients,
- updateClientStatus,
-} from "../../lib/devApi";
+import { fetchClients } from "../../lib/devApi";
import { t } from "../../lib/i18n";
import { cn } from "../../lib/utils";
function ClientsPage() {
const navigate = useNavigate();
- const queryClient = useQueryClient();
const { data, isLoading, error } = useQuery({
queryKey: ["clients"],
queryFn: fetchClients,
});
- const updateStatusMutation = useMutation({
- mutationFn: (payload: { id: string; status: "active" | "inactive" }) =>
- updateClientStatus(payload.id, payload.status),
- onSuccess: (_, variables) => {
- const statusText =
- variables.status === "active"
- ? t("ui.common.status.active", "활성화")
- : t("ui.common.status.inactive", "비활성화");
- toast(
- t(
- "msg.dev.clients.status_updated",
- "클라이언트가 {{status}}되었습니다.",
- {
- status: statusText,
- },
- ),
- );
- queryClient.invalidateQueries({ queryKey: ["clients"] });
- },
- onError: (error: AxiosError<{ error?: string }>) => {
- const errMsg =
- error.response?.data?.error ??
- error.message ??
- t(
- "msg.dev.clients.status_update_error",
- "Failed to update client status",
- );
- toast(errMsg, "error");
- },
- });
- const deleteMutation = useMutation({
- mutationFn: (clientId: string) => deleteClient(clientId),
- onSuccess: () => queryClient.invalidateQueries({ queryKey: ["clients"] }),
- });
const clients = data?.items || [];
const totalClients = clients.length;
@@ -159,7 +117,7 @@ function ClientsPage() {
{t("ui.dev.clients.registry.title", "RP registry")}