mirror of
https://github.com/documenso/documenso.git
synced 2025-11-22 20:51:33 +10:00
Rename component interfaces
This commit is contained in:
@ -6,17 +6,17 @@ import { ArrowLeftIcon } from "@heroicons/react/24/outline";
|
|||||||
import { FormProvider, useForm } from "react-hook-form";
|
import { FormProvider, useForm } from "react-hook-form";
|
||||||
import { toast } from "react-hot-toast";
|
import { toast } from "react-hot-toast";
|
||||||
|
|
||||||
interface IForgotPassword {
|
interface ForgotPasswordForm {
|
||||||
email: string;
|
email: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function ForgotPassword() {
|
export default function ForgotPassword() {
|
||||||
const methods = useForm<IForgotPassword>();
|
const methods = useForm<ForgotPasswordForm>();
|
||||||
const { register, formState, resetField } = methods;
|
const { register, formState, resetField } = methods;
|
||||||
|
|
||||||
const [resetSuccessful, setResetSuccessful] = useState(false);
|
const [resetSuccessful, setResetSuccessful] = useState(false);
|
||||||
|
|
||||||
const onSubmit = async (values: IForgotPassword) => {
|
const onSubmit = async (values: ForgotPasswordForm) => {
|
||||||
const response = await toast.promise(
|
const response = await toast.promise(
|
||||||
fetch(`/api/auth/forgot-password`, {
|
fetch(`/api/auth/forgot-password`, {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
|
|||||||
@ -7,7 +7,7 @@ import { ArrowLeftIcon } from "@heroicons/react/24/outline";
|
|||||||
import { FormProvider, useForm } from "react-hook-form";
|
import { FormProvider, useForm } from "react-hook-form";
|
||||||
import { toast } from "react-hot-toast";
|
import { toast } from "react-hot-toast";
|
||||||
|
|
||||||
interface IResetPassword {
|
interface ForgotPasswordForm {
|
||||||
password: string;
|
password: string;
|
||||||
confirmPassword: string;
|
confirmPassword: string;
|
||||||
}
|
}
|
||||||
@ -16,13 +16,13 @@ export default function ResetPassword(props: any) {
|
|||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const { token } = router.query;
|
const { token } = router.query;
|
||||||
|
|
||||||
const methods = useForm<IResetPassword>();
|
const methods = useForm<ForgotPasswordForm>();
|
||||||
const { register, formState, watch } = methods;
|
const { register, formState, watch } = methods;
|
||||||
const password = watch("password", "");
|
const password = watch("password", "");
|
||||||
|
|
||||||
const [resetSuccessful, setResetSuccessful] = useState(false);
|
const [resetSuccessful, setResetSuccessful] = useState(false);
|
||||||
|
|
||||||
const onSubmit = async (values: IResetPassword) => {
|
const onSubmit = async (values: ForgotPasswordForm) => {
|
||||||
const response = await toast.promise(
|
const response = await toast.promise(
|
||||||
fetch(`/api/auth/reset-password`, {
|
fetch(`/api/auth/reset-password`, {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
|
|||||||
Reference in New Issue
Block a user