Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feat]: 마이페이지 정보 요청시 리사이징된 이미지 URL을 전송 #87

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
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
8 changes: 8 additions & 0 deletions controller/userController.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable no-restricted-syntax */
/* eslint-disable arrow-parens */
/* eslint-disable no-unused-vars */
/* eslint-disable no-return-assign */
Expand All @@ -14,6 +15,9 @@ const { dayjs } = dateTimeModule;

const userService = require('../service/userService');

const IMAGE_ORIGIN_PATH = '/images/origin';
const IMAGE_W200_PATH = '/images/w_200';

module.exports = {
signup: async (req, res) => {
const { email, userName, password } = req.body;
Expand Down Expand Up @@ -126,6 +130,10 @@ module.exports = {
getMySuccessDay.forEach(day =>
(successDays += day.status));

for (const { dataValues } of getMyPage) { // send resized image URL
dataValues.timeStampImageUrl = dataValues.timeStampImageUrl.replace(IMAGE_ORIGIN_PATH, IMAGE_W200_PATH);
}

return res
.status(statusCode.OK)
.send(
Expand Down