why doesnt current admin data show up?
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
|
|
||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { useForm, type SubmitHandler } from "react-hook-form";
|
import { useForm, type SubmitHandler } from "react-hook-form";
|
||||||
@@ -41,6 +42,12 @@ export default function UserProfilePage() {
|
|||||||
formState: { errors, isDirty },
|
formState: { errors, isDirty },
|
||||||
} = useForm<UserProfileFormValues>({
|
} = useForm<UserProfileFormValues>({
|
||||||
resolver: zodResolver(userProfileSchema),
|
resolver: zodResolver(userProfileSchema),
|
||||||
|
defaultValues: {
|
||||||
|
name: "",
|
||||||
|
email: "",
|
||||||
|
password: "",
|
||||||
|
confirmPassword: ""
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@@ -66,6 +73,7 @@ export default function UserProfilePage() {
|
|||||||
title: "Profile Updated",
|
title: "Profile Updated",
|
||||||
description: "Your profile has been updated successfully.",
|
description: "Your profile has been updated successfully.",
|
||||||
});
|
});
|
||||||
|
// Reset form to new values and clear password fields
|
||||||
reset({ ...data, password: '', confirmPassword: '' });
|
reset({ ...data, password: '', confirmPassword: '' });
|
||||||
} else {
|
} else {
|
||||||
toast({
|
toast({
|
||||||
|
|||||||
Reference in New Issue
Block a user