Skip to content

Commit

Permalink
feat(#88): User API 작성
Browse files Browse the repository at this point in the history
feat(#88): User API 작성
  • Loading branch information
zyanlog authored Feb 20, 2024
2 parents 0b3f525 + 61a19ae commit 98387b7
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 23 deletions.
20 changes: 0 additions & 20 deletions src/controller/authController.js
Original file line number Diff line number Diff line change
Expand Up @@ -448,26 +448,6 @@ export const subscribePremium = async (req, res, next) => {
}
};

/*
* API No. 11
* API Name : 개인 포인트 순위 조회
* [GET] /auth/rank
*/
export const getUserRank = async(req, res, next) => {
try {
const users = await User.find().sort({ point: -1 }).limit(3);

if (users.length === 0) {
return res.send(errResponse(status.MEMBER_NOT_FOUND));
}

return res.send(response(status.SUCCESS, users));
} catch (err) {
console.log(err);
return res.send(errResponse(status.INTERNAL_SERVER_ERROR));
}
};

/*************************************************************************************/
// 이메일 유효성 검사
export const validEmailCheck = (email) => {
Expand Down
4 changes: 1 addition & 3 deletions src/router/authRouter.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import {
checkEmail,
findPassword,
subscribePremium,
getUserRank,
} from "../controller/authController";
import {
authenticateUser,
Expand All @@ -37,5 +36,4 @@ authRouter.patch("/find-password", findPassword); // 비밀번호 찾기
authRouter.post("/premium", authenticateUser, subscribePremium); // 프리미엄 구독
authRouter.get("/payment", function (req, res) {
res.render("payment");
});
authRouter.get("/rank", getUserRank); // 개인 포인트 순위 조회
});

0 comments on commit 98387b7

Please sign in to comment.