Create user on the function mutate, with TRPC and Payload
Hi everyone, I have faced issues with create user on the function mutate, with TRPC, I cant trace and debug it. TRPC is connected based on the log here as it return some testing value. Please help me. I been stucking for almost a week
page.tsx
"use client";
import { Icons } from "@/components/Icons";
import { Button, buttonVariants } from "@/components/ui/button";
import { Input } from "@/components/ui/input";
import { Label } from "@/components/ui/label";
import { cn } from "@/lib/utils";
import {
AuthCredentialsValidator,
TAuthCredentialsValidator,
} from "@/lib/validators/account-credentials-validator";
import { trpc } from "@/trpc/client";
import { zodResolver } from "@hookform/resolvers/zod";
import { ArrowRight } from "lucide-react";
import Link from "next/link";
import { useForm } from "react-hook-form";
const page = () => {
const {
register,
handleSubmit,
formState: { errors },
} = useForm<TAuthCredentialsValidator>({
resolver: zodResolver(AuthCredentialsValidator),
});
const { data } = trpc.anyApiRoute.useQuery();
const { mutate, isLoading } = trpc.auth.createPayloadUser.useMutation({});
const onSubmit = ({ email, password }: TAuthCredentialsValidator) => {
mutate({ email, password });
};
0 Replies