Skip to content
Snippets Groups Projects
Commit eafc8e84 authored by pjookim's avatar pjookim
Browse files

fix: update user identification method in name change route to use email instead of name

parent c7e3b181
No related branches found
No related tags found
No related merge requests found
......@@ -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: '유효하지 않은 요청입니다.'});
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment