From af906d5fde7801fcb48f9dc5c603bcc2962adf6d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=EC=A1=B0=EB=8C=80=ED=9D=AC?= <joedaehui@ajou.ac.kr>
Date: Mon, 9 Dec 2024 00:33:05 +0900
Subject: [PATCH] =?UTF-8?q?bugfix:=20req/res=20=EC=88=98=EC=A0=95?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 controllers/friendController.js | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/controllers/friendController.js b/controllers/friendController.js
index 09cbf57..e930a6e 100644
--- a/controllers/friendController.js
+++ b/controllers/friendController.js
@@ -12,7 +12,7 @@ class friendController {
     async sendFriendRequest(req, res) {
         try {
             return await performanceMonitor.measureAsync('sendFriendRequest', async () => {
-                const email  = req.body;
+                const { email }  = req.body;
                 const userId = req.user.id;
 
                 if (!userId || !email) {
@@ -162,7 +162,9 @@ class friendController {
 
                 return res.status(200).json({
                     success: true,
-                    data: friends
+                    data: {
+                        ...friends
+                    }
                 });
             });
         } catch (error) {
-- 
GitLab