Skip to content

Commit

Permalink
fix: type error in reset-password.tsx (#4081)
Browse files Browse the repository at this point in the history
  • Loading branch information
exKAZUu committed Feb 16, 2023
1 parent 430f0b5 commit e228ba5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/chatty-fireants-leave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@blitzjs/generator": patch
---

Fix a type error in reset password templates.
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { useEffect, useState } from "react"
import Layout from "src/core/layouts/Layout"
import { LabeledTextField } from "src/core/components/LabeledTextField"
import { Form, FORM_ERROR } from "src/core/components/Form"
Expand All @@ -8,6 +7,7 @@ import { BlitzPage, Routes } from "@blitzjs/next"
import { useRouter } from "next/router"
import { useMutation } from "@blitzjs/rpc"
import Link from "next/link"
import { assert } from "blitz"

const ResetPasswordPage: BlitzPage = () => {
const router = useRouter()
Expand Down Expand Up @@ -36,6 +36,7 @@ const ResetPasswordPage: BlitzPage = () => {
}}
onSubmit={async (values) => {
try {
assert(token, "token is required.")
await resetPasswordMutation({ ...values, token })
} catch (error: any) {
if (error.name === "ResetPasswordError") {
Expand Down

0 comments on commit e228ba5

Please sign in to comment.