GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [fix] mypage comment 없을 때 response body 수정 / 회원정보 수정 requeset body 수정 · Team-O2/Back-end2@7a2e49d

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • src
    • DTO
      • userDTO.ts
    • controller
      • user.ts
    • service
      • userService.ts
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎src/DTO/userDTO.ts‎

Copy file name to clipboardExpand all lines: src/DTO/userDTO.ts
+8-1Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,16 @@ namespace userDTO {
8383
challengeNum: number;
8484
}
8585

86+
// export interface userInfoReqDTO {
87+
// nickname: string;
88+
// interest: string[];
89+
// isMarketing: Boolean;
90+
// img?: File;
91+
// }
92+
8693
export interface userInfoReqDTO {
8794
nickname: string;
88-
interest: string[];
95+
interest: string;
8996
isMarketing: Boolean;
9097
img?: File;
9198
}
Collapse file

‎src/controller/user.ts‎

Copy file name to clipboardExpand all lines: src/controller/user.ts
+8-8Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -221,14 +221,14 @@ const getMyCommentsController = async (req: Request, res: Response) => {
221221
"잘못된 postModel 값입니다."
222222
);
223223
}
224-
// 3. 작성한 댓글이 없을 때
225-
else if (data === -3) {
226-
response.basicResponse(
227-
res,
228-
returnCode.NO_CONTENT,
229-
"작성한 댓글이 없습니다."
230-
);
231-
}
224+
// // 3. 작성한 댓글이 없을 때
225+
// else if (data === -3) {
226+
// response.basicResponse(
227+
// res,
228+
// returnCode.NO_CONTENT,
229+
// "작성한 댓글이 없습니다."
230+
// );
231+
// }
232232
// 4. 내가 쓴 댓글 조회 성공
233233
else {
234234
response.dataResponse(
Collapse file

‎src/service/userService.ts‎

Copy file name to clipboardExpand all lines: src/service/userService.ts
+11-11Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import period from "../library/date";
1717
import jwt from "jsonwebtoken";
1818
import bcrypt from "bcryptjs";
1919
import config from "../config";
20-
import { emailSender } from "../library";
20+
import { emailSender, array } from "../library";
2121
import ejs from "ejs";
2222
import { ConnectionTimedOutError, Op, QueryTypes, Sequelize } from "sequelize";
2323
// DTO
@@ -157,7 +157,7 @@ const getUserInfo = async (userID: number) => {
157157
const user = await User.findOne({
158158
where: {
159159
id: userID,
160-
},
160+
},
161161
attributes: ["isMarketing", "img", "id", "email", "nickname", "interest"],
162162
});
163163

@@ -724,11 +724,11 @@ const getMyComments = async (
724724
if (!commentList) {
725725
return -2;
726726
}
727-
// 3. 작성한 댓글이 없을 떄
728-
else if (!commentList.length) {
729-
// console.log(challengeList.length);
730-
return -3;
731-
}
727+
// // 3. 작성한 댓글이 없을 떄
728+
// else if (!commentList.length) {
729+
// // console.log(challengeList.length);
730+
// return -3;
731+
// }
732732

733733
const commentNum = commentList.length;
734734

@@ -1015,7 +1015,8 @@ const patchUserInfo = async (
10151015
body: userDTO.userInfoReqDTO,
10161016
url?
10171017
) => {
1018-
let { nickname, interest, isMarketing } = body;
1018+
let { nickname, isMarketing } = body;
1019+
let interest = array.stringToInterest(body.interest);
10191020

10201021
// 1. 요청 바디 부족
10211022
if (
@@ -1033,7 +1034,6 @@ const patchUserInfo = async (
10331034
return -2;
10341035
}
10351036

1036-
let newInterest = "";
10371037
const user = await User.findOne({
10381038
where: { id: userID },
10391039
});
@@ -1043,7 +1043,7 @@ const patchUserInfo = async (
10431043
await User.update(
10441044
{
10451045
nickname,
1046-
interest: interest.join(),
1046+
interest,
10471047
isMarketing,
10481048
img: url.img,
10491049
},
@@ -1053,7 +1053,7 @@ const patchUserInfo = async (
10531053
await User.update(
10541054
{
10551055
nickname,
1056-
interest: interest.join(),
1056+
interest: interest,
10571057
isMarketing,
10581058
},
10591059
{ where: { id: userID } }

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.