Skip to content

Commit

Permalink
Merge pull request #31 from TeamBookTez/fix/login-myInfo-api
Browse files Browse the repository at this point in the history
Fix/login my info api
  • Loading branch information
seohyun-106 authored Jan 13, 2022
2 parents 8d7792c + ffb0297 commit 70f0a11
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/controller/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ const postSignupController = async (req: Request, res: Response) => {

const postLoginController = async (req: Request, res: Response) => {
try {
const resData = await authService.postLoginService(req.body);
const resData = await authService.postLoginService(req.body.email, req.body.password);

if (resData === constant.NULL_VALUE) {
response.basicResponse(
Expand Down
2 changes: 1 addition & 1 deletion src/service/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ const postSignupService = async ({ email, nickname, password }) => {
* @access public
*/

const postLoginService = async ({ email, password }) => {
const postLoginService = async (email: string, password: string) => {
// 요청 바디 부족
if (!email || !password) {
return constant.NULL_VALUE;
Expand Down
3 changes: 2 additions & 1 deletion src/service/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import { User, Review } from "../models";
const getMyInfoService = async ( userId: number ) => {
// TODO: - user isDeleted 상태 확인
const user = await User.findOne({ where: { id: userId } });
const img = user.img;
const nickname = user.nickname;
const email = user.email;
const review = await Review.findAll({
Expand All @@ -28,7 +29,7 @@ const getMyInfoService = async ( userId: number ) => {
},
});
const reviewCount = review.length;
return { nickname, email, reviewCount };
return { img, nickname, email, reviewCount };
};

const userService = {
Expand Down

0 comments on commit 70f0a11

Please sign in to comment.