aboutsummaryrefslogtreecommitdiffstats
path: root/apps/web/components/signin/ResetPasswordForm.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'apps/web/components/signin/ResetPasswordForm.tsx')
-rw-r--r--apps/web/components/signin/ResetPasswordForm.tsx8
1 files changed, 6 insertions, 2 deletions
diff --git a/apps/web/components/signin/ResetPasswordForm.tsx b/apps/web/components/signin/ResetPasswordForm.tsx
index d4d8a285..571a09ae 100644
--- a/apps/web/components/signin/ResetPasswordForm.tsx
+++ b/apps/web/components/signin/ResetPasswordForm.tsx
@@ -20,13 +20,14 @@ import {
FormMessage,
} from "@/components/ui/form";
import { Input } from "@/components/ui/input";
-import { api } from "@/lib/trpc";
import { zodResolver } from "@hookform/resolvers/zod";
+import { useMutation } from "@tanstack/react-query";
import { TRPCClientError } from "@trpc/client";
import { AlertCircle, CheckCircle } from "lucide-react";
import { useForm } from "react-hook-form";
import { z } from "zod";
+import { useTRPC } from "@karakeep/shared-react/trpc";
import { zResetPasswordSchema } from "@karakeep/shared/types/users";
const resetPasswordSchema = z
@@ -44,6 +45,7 @@ interface ResetPasswordFormProps {
}
export default function ResetPasswordForm({ token }: ResetPasswordFormProps) {
+ const api = useTRPC();
const [isSuccess, setIsSuccess] = useState(false);
const [errorMessage, setErrorMessage] = useState("");
const router = useRouter();
@@ -52,7 +54,9 @@ export default function ResetPasswordForm({ token }: ResetPasswordFormProps) {
resolver: zodResolver(resetPasswordSchema),
});
- const resetPasswordMutation = api.users.resetPassword.useMutation();
+ const resetPasswordMutation = useMutation(
+ api.users.resetPassword.mutationOptions(),
+ );
const onSubmit = async (values: z.infer<typeof resetPasswordSchema>) => {
try {