diff --git a/packages/backend/src/db/db.ts b/packages/backend/src/db/db.ts index 1594b3f..d334739 100644 --- a/packages/backend/src/db/db.ts +++ b/packages/backend/src/db/db.ts @@ -1,5 +1,5 @@ import { ENV } from "../envVars"; -import { DB } from "../db-types"; // this is the Database interface we defined earlier +import { DB } from "../db-types"; import pg from "pg"; import { Kysely, PostgresDialect } from "kysely"; @@ -9,10 +9,6 @@ const dialect = new PostgresDialect({ }), }); -// Database interface is passed to Kysely's constructor, and from now on, Kysely -// knows your database structure. -// Dialect is passed to Kysely's constructor, and from now on, Kysely knows how -// to communicate with your database. export const db = new Kysely({ dialect, }); diff --git a/packages/frontend/src/routes/reset-password.$link.tsx b/packages/frontend/src/routes/reset-password.$link.tsx index a562dfa..0d2746d 100644 --- a/packages/frontend/src/routes/reset-password.$link.tsx +++ b/packages/frontend/src/routes/reset-password.$link.tsx @@ -11,9 +11,13 @@ const ResetPasswordAction = () => { const form = useForm(); const { link } = Route.useParams(); - const mutation = useMutation((body: ResetPasswordActionForm) => - api.post("/api/reset-password", { body: { newPassword: body.password, temporaryLink: link } }), - ); + const mutation = useMutation(async (body: ResetPasswordActionForm) => { + const result = await api.post("/api/reset-password", { body: { newPassword: body.password, temporaryLink: link } }); + + form.reset(); + + return result; + }); return (