import { LstCard } from "../../../components/ui/lstCard"; import { CardContent, CardDescription, CardHeader, CardTitle, } from "../../../components/ui/card"; import { useAppForm } from "../../../lib/formStuff"; import { api } from "../../../lib/axiosAPI"; import { toast } from "sonner"; import { Link } from "@tanstack/react-router"; export default function RequestResetPassword() { const form = useAppForm({ defaultValues: { email: "", }, onSubmit: async ({ value }) => { try { const res = await api.post("api/user/resetpassword", { email: value.email, }); console.log(res); if (res.status === 200) { toast.success( res.data.message ? res.data.message : "If this email exists in our system, check your email for the reset link" ); } } catch (error) { console.log(error); } }, }); return (