From eafc8e844298c6bd3a9de049d41af64451b3a40e Mon Sep 17 00:00:00 2001
From: pjookim <pjookim@naver.com>
Date: Fri, 6 Dec 2024 16:09:36 +0900
Subject: [PATCH] fix: update user identification method in name change route
 to use email instead of name

---
 route/conf_name.js | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/route/conf_name.js b/route/conf_name.js
index 06c88e0..53c1fe0 100644
--- a/route/conf_name.js
+++ b/route/conf_name.js
@@ -12,12 +12,12 @@ router.get('/change', (req, res) => {
 
 //사용자 이름 변경(닉네임)
 router.post('/change', async (req, res) => {
-    const { name, newName } = req.body;
+    const { email, newName } = req.body;
 
-    const user = await User.findOne({ name });
+    const user = await User.findOne({ email });
 
     try {
-        if (!name || !newName) {
+        if (!email || !newName) {
             return res.status(400).json({message: '유효하지 않은 요청입니다.'});
         }
 
-- 
GitLab