From 8f4fbbb37c7c996945915314cc770ba83a3a2d54 Mon Sep 17 00:00:00 2001 From: 14Kgun Date: Wed, 27 Sep 2023 18:09:57 +0900 Subject: [PATCH 1/2] Fix: logininfo API --- src/modules/stores/mongo.js | 2 +- src/routes/docs/logininfo.js | 4 ++++ src/services/logininfo.js | 3 ++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/modules/stores/mongo.js b/src/modules/stores/mongo.js index 119e0c0d..7cd59b87 100755 --- a/src/modules/stores/mongo.js +++ b/src/modules/stores/mongo.js @@ -12,7 +12,7 @@ const userSchema = Schema({ ongoingRoom: [{ type: Schema.Types.ObjectId, ref: "Room" }], // 참여중인 진행중인 방 배열 doneRoom: [{ type: Schema.Types.ObjectId, ref: "Room" }], // 참여중인 완료된 방 배열 withdraw: { type: Boolean, default: false }, - phoneNumber: { type: String }, // 전화번호 (2023FALL 이벤트부터 추가) + phoneNumber: { type: String, default: "" }, // 전화번호 (2023FALL 이벤트부터 추가) ban: { type: Boolean, default: false }, //계정 정지 여부 joinat: { type: Date, required: true }, //가입 시각 agreeOnTermsOfService: { type: Boolean, default: false }, //이용약관 동의 여부 diff --git a/src/routes/docs/logininfo.js b/src/routes/docs/logininfo.js index b24c5fe6..f572f942 100644 --- a/src/routes/docs/logininfo.js +++ b/src/routes/docs/logininfo.js @@ -30,6 +30,10 @@ const logininfoDocs = { withdraw: { type: "boolean", }, + phoneNumber: { + type: "string", + description: "사용자 전화번호", + }, ban: { type: "boolean", }, diff --git a/src/services/logininfo.js b/src/services/logininfo.js index 32a6b96d..eebb09ff 100644 --- a/src/services/logininfo.js +++ b/src/services/logininfo.js @@ -9,7 +9,7 @@ const logininfoHandler = async (req, res) => { const userDetail = await userModel.findOne( { id: user.id }, - "_id name nickname id withdraw ban joinat agreeOnTermsOfService subinfo email profileImageUrl account" + "_id name nickname id withdraw phoneNumber ban joinat agreeOnTermsOfService subinfo email profileImageUrl account" ); res.json({ @@ -18,6 +18,7 @@ const logininfoHandler = async (req, res) => { name: userDetail.name, nickname: userDetail.nickname, withdraw: userDetail.withdraw, + phoneNumber: userDetail.phoneNumber, ban: userDetail.ban, joinat: userDetail.joinat, agreeOnTermsOfService: userDetail.agreeOnTermsOfService, From 18f65b9819d40647e95a3ca5b734aab7d6be4660 Mon Sep 17 00:00:00 2001 From: 14Kgun Date: Wed, 27 Sep 2023 20:13:39 +0900 Subject: [PATCH 2/2] Fix: schema of phoneNumber --- src/modules/stores/mongo.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/stores/mongo.js b/src/modules/stores/mongo.js index 7cd59b87..119e0c0d 100755 --- a/src/modules/stores/mongo.js +++ b/src/modules/stores/mongo.js @@ -12,7 +12,7 @@ const userSchema = Schema({ ongoingRoom: [{ type: Schema.Types.ObjectId, ref: "Room" }], // 참여중인 진행중인 방 배열 doneRoom: [{ type: Schema.Types.ObjectId, ref: "Room" }], // 참여중인 완료된 방 배열 withdraw: { type: Boolean, default: false }, - phoneNumber: { type: String, default: "" }, // 전화번호 (2023FALL 이벤트부터 추가) + phoneNumber: { type: String }, // 전화번호 (2023FALL 이벤트부터 추가) ban: { type: Boolean, default: false }, //계정 정지 여부 joinat: { type: Date, required: true }, //가입 시각 agreeOnTermsOfService: { type: Boolean, default: false }, //이용약관 동의 여부