Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/controllers/comment.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export const handleAddComment = async (req, res, next) => {
*/

try{
console.log("댓글 추가를 요청했습니다!");
// console.log("댓글 추가를 요청했습니다!");
const commentData = bodyToComment(req.body, req.user.id ,parseInt(req.params.momentId));
const newComment = await addUserComment(commentData);
res.status(StatusCodes.OK).success(newComment);
Expand Down Expand Up @@ -146,7 +146,7 @@ export const handleAddComment = async (req, res, next) => {

*/
try{
console.log("댓글 수정 기능 요청했습니다!");
// console.log("댓글 수정 기능 요청했습니다!");
const momentId = parseInt(req.params.momentId);
const commentId = parseInt(req.params.commentId);
const editData = bodyToEditComment(req.body, req.user.id, momentId, commentId);
Expand Down Expand Up @@ -208,7 +208,7 @@ export const handleAddComment = async (req, res, next) => {
*/

try{
console.log("댓글 삭제 기능 요청");
// console.log("댓글 삭제 기능 요청");
const deleteData = bodyToDeleteComment(req.user.id, req.params.commentId);
const deleteComment = await deleteUserComment(deleteData);
res.status(StatusCodes.OK).success(deleteComment);
Expand Down
4 changes: 2 additions & 2 deletions src/errors.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ export class LikeIdMissingError extends Error {
statusCode = 400; // Bad Request

constructor(data) {
const reason = 'likeId가 요청 데이터에 없습니다';
const reason = 'likeId가 요청 데이터에 없습니다.';
super(reason);
this.reason = reason;
this.data = data;
Expand Down Expand Up @@ -217,7 +217,7 @@ export class momentIdNotFoundError extends Error {
statusCode = 404; // Not Found

constructor(data) {
const reason = '존재하지 않는 게시글입니다';
const reason = '존재하지 않는 게시글입니다.';
super(reason);
this.reason = reason;
this.data = data;
Expand Down
4 changes: 0 additions & 4 deletions src/services/comment.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ try {
const momentExists = await prisma.moment.findUnique({
where: { id: data.momentId },
});

if (!data.userId) {
throw new Error("userId가 요청되지 않았습니다.");
}
if (!momentExists) {
throw new momentIdNotFoundError(data);
}
Expand Down