From f5d3060b75850bafb899fdf3a5ec701f8bf4faaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Paulo=20Fricks?= Date: Sun, 28 Apr 2024 00:52:56 -0300 Subject: [PATCH 1/3] improvement: Reset form field after successful fetch --- src/pages/auth/forgot-password.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/pages/auth/forgot-password.tsx b/src/pages/auth/forgot-password.tsx index cd25fd4..3026603 100644 --- a/src/pages/auth/forgot-password.tsx +++ b/src/pages/auth/forgot-password.tsx @@ -23,6 +23,7 @@ export default function ForgotPassword() { const { handleSubmit, register, + resetField, formState: { errors, isSubmitting } } = useForm({ resolver: zodResolver(forgotPasswordFormSchema), @@ -39,6 +40,8 @@ export default function ForgotPassword() { body: JSON.stringify(values) }); + resetField("email"); + addToast({ title: "E-mail enviado com sucesso.", message: From 483f4ff8c22e23aab3320db12bac685b333db74d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Paulo=20Fricks?= Date: Sun, 28 Apr 2024 00:53:40 -0300 Subject: [PATCH 2/3] improvement: Redirect to the auth/signin route after 5 seconds --- src/pages/auth/forgot-password.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/pages/auth/forgot-password.tsx b/src/pages/auth/forgot-password.tsx index 3026603..825938f 100644 --- a/src/pages/auth/forgot-password.tsx +++ b/src/pages/auth/forgot-password.tsx @@ -49,7 +49,9 @@ export default function ForgotPassword() { type: "success" }); - route.push("/auth/signin"); + setTimeout(() => { + route.push("/auth/signin"); + }, 5000); } catch (error) { addToast({ title: "Erro ao processar solicitação.", From af4079c30e7793f604a04c51febf622b48edef4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Paulo=20Fricks?= Date: Sun, 28 Apr 2024 00:56:06 -0300 Subject: [PATCH 3/3] =?UTF-8?q?Update=20changelog=20=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 1 + package.json | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 1b1f2c3..f21ac2f 100644 --- a/README.md +++ b/README.md @@ -80,6 +80,7 @@ And that's it! Your `SkateHub Frontend` should now be up and running locally on ### 2024 +- 2024-04-28 - Update the `forgot-password` page of the SkateHub project [#20](https://github.com/jpcmf/Frontend-GraduateProgram-FullStack-2024/pull/20) _(v0.1.16)_ - 2024-04-28 - Redirect to the root route when attempting to access /auth [#19](https://github.com/jpcmf/Frontend-GraduateProgram-FullStack-2024/pull/19) _(v0.1.15)_ - 2024-04-28 - Create the `forgot-password` page of the SkateHub project [#18](https://github.com/jpcmf/Frontend-GraduateProgram-FullStack-2024/pull/18) _(v0.1.14)_ - 2024-04-11 - Update the `signin` page of the SkateHub project [#17](https://github.com/jpcmf/Frontend-GraduateProgram-FullStack-2024/pull/17) _(v0.1.13)_ diff --git a/package.json b/package.json index 84a0444..c167c2b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "frontend", - "version": "0.1.15", + "version": "0.1.16", "private": true, "scripts": { "dev": "next dev",