diff --git a/src/api/auth/mutations.ts b/src/api/auth/mutations.ts index d29d2029..98fd7f33 100644 --- a/src/api/auth/mutations.ts +++ b/src/api/auth/mutations.ts @@ -12,7 +12,7 @@ import { emailVerificationExpiration } from "@/types/constants" import { env } from "env.mjs" export const register = async ({ input }: apiInputFromSchema) => { - const { email, password, username } = signUpSchema().parse(input) + const { email, password, username } = input try { const hashedPassword = await hash(password, 12) diff --git a/src/api/me/email/mutation.ts b/src/api/me/email/mutation.ts index 03cd9157..3f1d3e3f 100644 --- a/src/api/me/email/mutation.ts +++ b/src/api/me/email/mutation.ts @@ -11,7 +11,7 @@ import { env } from "env.mjs" export const sendVerificationEmail = async ({ input }: apiInputFromSchema) => { try { - const { email, silent } = sendVerificationEmailSchema().parse(input) + const { email, silent } = input const token = randomUUID() const user = await prisma.user.findUnique({ @@ -86,7 +86,7 @@ export const sendVerificationEmail = async ({ input }: apiInputFromSchema) => { try { - const { token } = verifyEmailSchema().parse(input) + const { token } = input const userEmailVerificationToken = await prisma.userEmailVerificationToken.findUnique({ where: { diff --git a/src/api/me/mutation.ts b/src/api/me/mutation.ts index bb1b2dcb..81e1b091 100644 --- a/src/api/me/mutation.ts +++ b/src/api/me/mutation.ts @@ -9,7 +9,7 @@ import { rolesAsObject } from "@/types/constants" export const updateUser = async ({ input, ctx: { session } }: apiInputFromSchema) => { ensureLoggedIn(session) try { - const { username } = updateUserSchema().parse(input) + const { username } = input //* Update the user const user = await prisma.user.update({ where: { id: session.user.id }, diff --git a/src/api/me/password/mutation.ts b/src/api/me/password/mutation.ts index 09dd20ac..a0fc3da4 100644 --- a/src/api/me/password/mutation.ts +++ b/src/api/me/password/mutation.ts @@ -12,7 +12,7 @@ import { env } from "env.mjs" export const forgotPassword = async ({ input }: apiInputFromSchema) => { try { - const { email } = forgotPasswordSchema().parse(input) + const { email } = input //? Check if user exists const user = await prisma.user.findUnique({ where: { @@ -74,7 +74,7 @@ export const forgotPassword = async ({ input }: apiInputFromSchema) => { try { - const { token, password } = resetPasswordSchema().parse(input) + const { token, password } = input const resetPassordToken = await prisma.resetPassordToken.findUnique({ where: { token, diff --git a/src/api/me/sessions/mutation.ts b/src/api/me/sessions/mutation.ts index 719ac74a..1fee311d 100644 --- a/src/api/me/sessions/mutation.ts +++ b/src/api/me/sessions/mutation.ts @@ -6,7 +6,7 @@ import { apiInputFromSchema } from "@/types" export const deleteSession = async ({ input, ctx: { session } }: apiInputFromSchema) => { try { ensureLoggedIn(session) - const { id, sessionToken } = deleteSessionSchema().parse(input) + const { id, sessionToken } = input //* Delete session const deletedSession = await prisma.session.delete({ where: {