Fixed incorrect variable & also clears old errors now

This commit is contained in:
Alex van Andel committed 2021-06-09 20:32:02 +00:00
1 parent 28eec8ed7f
commit f24ca5b672
2 files changed
+5 -2

No files matched your search

+1 -1
View File
@@ -25,7 +25,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
const username = req.body.username;
// username is changed: username is optional but it is necessary to be unique, enforce here
if (username !== user.username) {
if (username !== session.user.username) {
const userConflict = await prisma.user.findFirst({
where: {
username,