From 741433ea04b023312a00f0d93d603d99889c9fcc Mon Sep 17 00:00:00 2001 From: hyejungg Date: Sun, 31 Dec 2023 13:37:38 +0900 Subject: [PATCH] =?UTF-8?q?[fix]=20=EB=94=94=EB=B2=84=EA=B9=85=EC=9A=A9=20?= =?UTF-8?q?=EC=BD=94=EB=93=9C=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/models/user.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/models/user.js b/src/models/user.js index 3b56eec..2f95529 100644 --- a/src/models/user.js +++ b/src/models/user.js @@ -59,9 +59,6 @@ module.exports = { 'SELECT user_id, fcm_token FROM users WHERE fcm_token = ?'; const [selectFcmToken] = await db.query(sqlSelectByFcmToken, [fcmToken]); - console.log(selectFcmToken); - console.log(selectFcmToken.length >= 1); - if (selectFcmToken.length >= 1) { const sqlUpdate = 'UPDATE users SET fcm_token = null WHERE user_id = ?'; const [updateRows] = await db.queryWithTransaction(sqlUpdate, [ @@ -100,7 +97,7 @@ module.exports = { const [rows] = await db.query(sqlSelect, [email]); - if (rows.affectedRows < 1) { + if (rows.length > 1) { throw new NotFound(ErrorMessage.unValidateUser); } @@ -122,7 +119,7 @@ module.exports = { const [rows] = await db.query(sqlSelect, [userId]); - if (rows.affectedRows < 1) { + if (rows.length > 1) { throw new NotFound(ErrorMessage.unValidateUser); }