Fixed incorrect variable & also clears old errors now
This commit is contained in:
1 parent
28eec8ed7f
commit
f24ca5b672
2 files changed
+5
-2
No files matched your search
@@ -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,
|
||||
|
||||
Reference in new issue
Block a user