Skip to content

Commit 78e085e

Browse files
committed
필요없는 코드 삭제
1 parent ae6db4d commit 78e085e

File tree

1 file changed

+0
-44
lines changed

1 file changed

+0
-44
lines changed

controller/explorationController.js

-44
Original file line numberDiff line numberDiff line change
@@ -223,50 +223,6 @@ module.exports = {
223223
}
224224
},
225225

226-
// 다른 글 둘러보기 (흥미최신 sorting 쿼리 없는 조건 [NEW]) - 좋아요 기능 추가
227-
getExpAnswersWithoutLen: async (req, res) => {
228-
try {
229-
let { page, category } = req.query;
230-
const user_nickname = req.decoded.id;
231-
232-
// page 오류 처리
233-
if (page == 0) {
234-
return res.status(code.BAD_REQUEST).send(util.fail(code.BAD_REQUEST, message.NO_INVALID_PAGE))
235-
}
236-
if (!page) {
237-
return res.status(code.BAD_REQUEST).send(util.fail(code.BAD_REQUEST, message.OUT_OF_VALUE));
238-
}
239-
240-
// 카테고리
241-
const category_attr = {};
242-
if ( category ) {
243-
if(category > 0 && category < 7) {
244-
category_attr[Op.eq]= category;
245-
} else {
246-
return res.status(code.BAD_REQUEST).send(util.fail(code.BAD_REQUEST, message.INVALID_CATEGORY_ID));
247-
}
248-
249-
} else {
250-
category_attr[Op.not]= null;
251-
}
252-
253-
// 데베에서 가져오기
254-
let answers = await explorationService.sortNewAnswersWithPagination(user_nickname, category_attr, page)
255-
if (answers == message.NO_RESULT) {
256-
res.status(code.OK).send(util.success(code.OK, message.NO_RESULT));
257-
}
258-
259-
// 답변 포맷팅
260-
answers = await explorationService.getFormattedAnswers(answers, user_nickname);
261-
262-
return res.status(code.OK).send(util.success(code.OK, message.GET_EXPLORATION_RESULT_SUCCESS, {user_nickname, answers}))
263-
264-
} catch (err) {
265-
console.error(err);
266-
return res.status(code.INTERNAL_SERVER_ERROR).send(util.fail(code.INTERNAL_SERVER_ERROR, message.INTERNAL_SERVER_ERROR));
267-
}
268-
},
269-
270226
// 스크랩 하기 & 스크랩 취소하기 -> 스크랩 했는지 안했는지 유무 안알려주고 생성 삭제만
271227
doOrCancelScrap: async (req, res) => {
272228
const answer_id = req.params.answerId;

0 commit comments

Comments
 (0)