diff --git a/apps/cs/src/pages/code/ui/lwpocode-dialog.tsx b/apps/cs/src/pages/code/ui/lwpocode-dialog.tsx index c11c57332..d6c6bb685 100644 --- a/apps/cs/src/pages/code/ui/lwpocode-dialog.tsx +++ b/apps/cs/src/pages/code/ui/lwpocode-dialog.tsx @@ -1,7 +1,7 @@ import { memo } from "react"; import { useForm } from "react-hook-form"; import { zodResolver } from "@hookform/resolvers/zod"; -import { useQuery } from "@tanstack/react-query"; +import { useQuery, useQueryClient } from "@tanstack/react-query"; import { useConfirm } from "@frontend-opensource/use-react-hooks"; import { Button, @@ -50,8 +50,8 @@ const LwpoCodeManagementDialog = memo( ...props }: ManagementLwpoCodeDialogProps) => { const isRegistration = !lwpoCd; - const { confirm } = useConfirm(); + const queryClient = useQueryClient(); const alert = useAlertStore((state) => state.setMessage); const { data: detailData } = useQuery({ @@ -70,6 +70,9 @@ const LwpoCodeManagementDialog = memo( mutationFn: (data: LwpoCodeFormData) => LwpoCodeApi.createLwpoCode(data), onSuccess: () => { alert("등록되었습니다.", () => onOpenChange?.(false)); + queryClient.invalidateQueries({ + queryKey: [ENDPOINT.CMS_SERVICE.LWPO_CODE, upCd], + }); }, }); @@ -251,6 +254,9 @@ const LwpoCodeManagementDialog = memo( {...field} type="number" value={field.value ?? 0} + onChange={(e) => { + field.onChange(parseInt(e.target.value)); + }} className="!text-[1.3rem]" placeholder="정렬순서를 입력해주세요" /> diff --git a/apps/cs/src/pages/code/ui/lwpocode-section.tsx b/apps/cs/src/pages/code/ui/lwpocode-section.tsx index c6025b338..15773c5f4 100644 --- a/apps/cs/src/pages/code/ui/lwpocode-section.tsx +++ b/apps/cs/src/pages/code/ui/lwpocode-section.tsx @@ -116,6 +116,7 @@ function LwpoCodeSection({ upCd }: LwpoCodeSectionProps) { 코드갱신