diff --git a/app/[locale]/(protected)/admin/management-user/external/detail/[id]/page.tsx b/app/[locale]/(protected)/admin/management-user/external/detail/[id]/page.tsx index f8a2432a..ad272826 100644 --- a/app/[locale]/(protected)/admin/management-user/external/detail/[id]/page.tsx +++ b/app/[locale]/(protected)/admin/management-user/external/detail/[id]/page.tsx @@ -76,8 +76,6 @@ export default function EditUserForm() { }, }); - - useEffect(() => { initData(); }, []); diff --git a/app/[locale]/(protected)/admin/management-user/external/edit/[id]/page.tsx b/app/[locale]/(protected)/admin/management-user/external/edit/[id]/page.tsx index ccab876f..ed402dc7 100644 --- a/app/[locale]/(protected)/admin/management-user/external/edit/[id]/page.tsx +++ b/app/[locale]/(protected)/admin/management-user/external/edit/[id]/page.tsx @@ -114,7 +114,8 @@ export default function EditUserForm() { }, }); - + const passwordVal = form.watch("password"); + const confPasswordVal = form.watch("confirmPassword"); useEffect(() => { initData(); @@ -353,7 +354,7 @@ export default function EditUserForm() { rules={["minLength", "specialChar", "number", "capital", "match"]} minLength={8} value={passwordVal || ""} - valueAgain={confPasswordVal} + valueAgain={confPasswordVal || ""} onChange={(isValid) => { form.setValue("isValidPassword", isValid); }} diff --git a/app/[locale]/(protected)/admin/management-user/internal/create/page.tsx b/app/[locale]/(protected)/admin/management-user/internal/create/page.tsx index 818e90b6..ba4eb2de 100644 --- a/app/[locale]/(protected)/admin/management-user/internal/create/page.tsx +++ b/app/[locale]/(protected)/admin/management-user/internal/create/page.tsx @@ -192,7 +192,9 @@ export default function CreateUserForm() { }, }); - + const passwordVal = form.watch("password"); + const confPasswordVal = form.watch("confirmPassword"); + const selectedRole = form.watch("role"); useEffect(() => { initFetch(); @@ -750,7 +752,7 @@ export default function CreateUserForm() { rules={["minLength", "specialChar", "number", "capital", "match"]} minLength={8} value={passwordVal || ""} - valueAgain={confPasswordVal} + valueAgain={confPasswordVal || ""} onChange={(isValid) => { form.setValue("isValidPassword", isValid); }} diff --git a/app/[locale]/(protected)/admin/management-user/internal/detail/[id]/page.tsx b/app/[locale]/(protected)/admin/management-user/internal/detail/[id]/page.tsx index 23bea489..cec7845c 100644 --- a/app/[locale]/(protected)/admin/management-user/internal/detail/[id]/page.tsx +++ b/app/[locale]/(protected)/admin/management-user/internal/detail/[id]/page.tsx @@ -191,7 +191,7 @@ export default function DetailUserForm() { }, }); - + const selectedRole = form.watch("role"); useEffect(() => { getDataAdditional(); diff --git a/app/[locale]/(protected)/admin/management-user/internal/edit/[id]/page.tsx b/app/[locale]/(protected)/admin/management-user/internal/edit/[id]/page.tsx index 81f8095e..d21b5135 100644 --- a/app/[locale]/(protected)/admin/management-user/internal/edit/[id]/page.tsx +++ b/app/[locale]/(protected)/admin/management-user/internal/edit/[id]/page.tsx @@ -195,7 +195,9 @@ export default function EditUserForm() { }, }); - + const passwordVal = form.watch("password"); + const confPasswordVal = form.watch("confirmPassword"); + const selectedRole = form.watch("role"); useEffect(() => { getDataAdditional(); @@ -755,7 +757,7 @@ export default function EditUserForm() { rules={["minLength", "specialChar", "number", "capital", "match"]} minLength={8} value={passwordVal || ""} - valueAgain={confPasswordVal} + valueAgain={confPasswordVal || ""} onChange={(isValid) => { form.setValue("isValidPassword", isValid); }}