[cs] feat: 다이얼로그 닫힐 때 폼 및 쿼리 로직 초기화

This commit is contained in:
2026-02-06 11:26:40 +09:00
parent 7227b98961
commit 8565331e68
6 changed files with 58 additions and 23 deletions
@@ -1,4 +1,4 @@
import { useState, memo } from "react";
import { useState, memo, useEffect } from "react";
import { useForm } from "react-hook-form";
import { zodResolver } from "@hookform/resolvers/zod";
import { useQuery } from "@tanstack/react-query";
@@ -90,6 +90,10 @@ const ManagementAuthorityDialog = memo(
}
};
useEffect(() => {
if (!open) form.reset();
}, [open]);
return (
<Dialog open={open} onOpenChange={setOpen}>
<DialogTrigger asChild>