feat: update signup and OTP verification forms to enhance error handling and state management
All checks were successful
Build and Push Docker Images / Build and Push Docker Images (push) Successful in 4m16s

This commit is contained in:
2025-04-17 15:18:01 +05:00
parent 470e8452b5
commit 1e023ebf13
3 changed files with 26 additions and 37 deletions

View File

@ -34,6 +34,9 @@ export default function SignUpForm() {
const [actionState, action, isPending] = React.useActionState(signup, {
message: "",
db_error: "",
errors: undefined,
payload: new FormData(),
});
React.useEffect(() => {

View File

@ -4,11 +4,9 @@ import { Button } from "@/components/ui/button";
import { Input } from "@/components/ui/input";
import { Label } from "@/components/ui/label";
import { VerifyRegistrationOTP } from "@/queries/authentication";
import { zodResolver } from "@hookform/resolvers/zod";
import { Loader2 } from "lucide-react";
import { signIn } from "next-auth/react";
import Link from "next/link";
import { redirect, useRouter, useSearchParams } from "next/navigation";
import { redirect, useSearchParams } from "next/navigation";
import { useActionState } from "react";
export default function VerifyRegistrationOTPForm({
@ -42,7 +40,6 @@ export default function VerifyRegistrationOTPForm({
type="number"
name="mobile"
defaultValue={phone_number}
value={phone_number}
hidden
/>
<Input