diff --git a/apps/cs/src/pages/groups/ui/groups-dialog.tsx b/apps/cs/src/pages/groups/ui/groups-dialog.tsx index 9fca4ebdb..ac7f92916 100644 --- a/apps/cs/src/pages/groups/ui/groups-dialog.tsx +++ b/apps/cs/src/pages/groups/ui/groups-dialog.tsx @@ -43,7 +43,7 @@ const GroupsDialog = memo( const { data: group } = useQuery({ queryKey: [ENDPOINT.CMS_SERVICE.GROUPS, groupId], queryFn: () => GroupApi.findGroupById(groupId!), - enabled: !!groupId && open, // open 시점 groupId가 있을 때만 상세 조회 API 호출 + enabled: !isRegistration, }); const { mutateAsync: createGroup } = useMutationWrapper({ @@ -92,8 +92,9 @@ const GroupsDialog = memo( }; useEffect(() => { - if (open) form.reset(); - }, [open]); + // 그룹 등록 및 취소 시 폼 초기화 + if (isRegistration && !open) form.reset(); + }, [groupId, open]); return ( diff --git a/apps/cs/src/pages/groups/ui/role-select.tsx b/apps/cs/src/pages/groups/ui/role-select.tsx index 539888591..bede34ed8 100644 --- a/apps/cs/src/pages/groups/ui/role-select.tsx +++ b/apps/cs/src/pages/groups/ui/role-select.tsx @@ -16,7 +16,13 @@ type RoleSelectProps = React.ComponentPropsWithoutRef & { function RoleSelect({ mngrYn = "N", ...props }: RoleSelectProps) { const { data: roles } = useQuery({ queryKey: [ENDPOINT.USER_SERVICE.ROLES], - queryFn: () => RoleApi.getRoles(), + queryFn: () => + RoleApi.getRoles({ + keywordType: "useYn", + keyword: "Y", + page: 0, + size: 100, + }), }); const options = roles?.content.filter((role) => role.mngrYn === mngrYn); diff --git a/apps/cs/src/pages/role/model/table-columns.tsx b/apps/cs/src/pages/role/model/table-columns.tsx index 71da16cfe..dcebbc736 100644 --- a/apps/cs/src/pages/role/model/table-columns.tsx +++ b/apps/cs/src/pages/role/model/table-columns.tsx @@ -3,13 +3,8 @@ import { useState } from "react"; import type { Role } from "@/entities/role"; import type { ColumnDef } from "@tanstack/react-table"; import { MappingRoleDialog } from "../ui/mapping-role-dialog"; -import { Button } from "@common/components"; -export const createColumns = ({ - deleteRole, -}: { - deleteRole: (roleId: string) => void; -}): ColumnDef[] => [ +export const createColumns = (): ColumnDef[] => [ { id: "no", header: "NO", @@ -44,18 +39,7 @@ export const createColumns = ({ { id: "action", header: "관리", - cell: ({ row }) => ( -
- - -
- ), + cell: ({ row }) => , }, ]; diff --git a/apps/cs/src/pages/role/ui/modify-page.tsx b/apps/cs/src/pages/role/ui/modify-page.tsx index 37f00836f..52c67f4b0 100644 --- a/apps/cs/src/pages/role/ui/modify-page.tsx +++ b/apps/cs/src/pages/role/ui/modify-page.tsx @@ -24,13 +24,6 @@ function ModifyPage({ roleId }: { roleId: string }) { }, }); - const { mutateAsync: deleteRole } = useMutationWrapper({ - mutationFn: () => RoleApi.deleteRole(roleId), - onSuccess: () => { - alert("삭제되었습니다.", () => router.push("/role")); - }, - }); - const form = useForm({ resolver: zodResolver(roleFormSchema), values: { @@ -47,12 +40,7 @@ function ModifyPage({ roleId }: { roleId: string }) {

권한 수정

- + ); } diff --git a/apps/cs/src/pages/role/ui/role-form.tsx b/apps/cs/src/pages/role/ui/role-form.tsx index bb67adb42..7a4653a9d 100644 --- a/apps/cs/src/pages/role/ui/role-form.tsx +++ b/apps/cs/src/pages/role/ui/role-form.tsx @@ -26,7 +26,6 @@ type RoleFormProps = { roleId?: string; form: UseFormReturn; handleSave: (data: RoleFormData) => Promise; - handleDelete?: () => Promise; }; function RoleForm({ roleId, form, handleSave, ...props }: RoleFormProps) { diff --git a/apps/cs/src/pages/role/ui/role-page.tsx b/apps/cs/src/pages/role/ui/role-page.tsx index 47d3d9a9e..b370ed338 100644 --- a/apps/cs/src/pages/role/ui/role-page.tsx +++ b/apps/cs/src/pages/role/ui/role-page.tsx @@ -7,7 +7,7 @@ import { getCoreRowModel, type PaginationState } from "@tanstack/react-table"; import { Button, Input, Label } from "@common/components"; import { RoleApi, type Role, type RoleParams } from "@/entities/role"; import { ENDPOINT } from "@/shared/config"; -import { useAlertStore, useDataTable, useMutationWrapper } from "@/shared/lib"; +import { useAlertStore, useDataTable } from "@/shared/lib"; import { createColumns } from "../model/table-columns"; function RolePage() { @@ -16,6 +16,7 @@ function RolePage() { const [keyword, setKeyword] = useState(""); const [searchParams, setSearchParams] = useState({ + keywordType: "roleName", keyword: "", sort: "regDt,desc", }); @@ -34,13 +35,6 @@ function RolePage() { }), }); - const { mutateAsync: deleteRole } = useMutationWrapper({ - mutationFn: (roleId: string) => RoleApi.deleteRole(roleId), - onSuccess: () => { - alert("삭제되었습니다.", query.refetch); - }, - }); - const handleRowClick = (row: Role) => { router.push(`/role/register/${row.roleId}`); }; @@ -48,9 +42,7 @@ function RolePage() { const { tableComponent } = useDataTable({ query, tableOptions: { - columns: createColumns({ - deleteRole, - }), + columns: createColumns(), state: { pagination, },