From ff248d6270a1935542d27dcdb10e21ad85c4d39e Mon Sep 17 00:00:00 2001 From: "Kalle (Sendou)" <38327916+Sendouc@users.noreply.github.com> Date: Sat, 8 May 2021 17:59:01 +0300 Subject: [PATCH] Trim custom url before saving to DB Was causing 404 errors when users accidentally included white space after the custom url --- pages/api/me/profile.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pages/api/me/profile.ts b/pages/api/me/profile.ts index 23af60eb8..b008b3710 100644 --- a/pages/api/me/profile.ts +++ b/pages/api/me/profile.ts @@ -40,9 +40,11 @@ const profileHandler = async (req: NextApiRequest, res: NextApiResponse) => { create: { user: { connect: { id: user.id } }, ...parsed.data, + customUrlPath: parsed.data.customUrlPath?.trim(), }, update: { ...parsed.data, + customUrlPath: parsed.data.customUrlPath?.trim(), }, where: { userId: user.id }, });