diff --git a/.github/workflows/deploy-production.yml b/.github/workflows/deploy-production.yml index eceeac9..de41551 100644 --- a/.github/workflows/deploy-production.yml +++ b/.github/workflows/deploy-production.yml @@ -41,4 +41,4 @@ jobs: GITHUB_TOKEN: ${{ secrets.TOKEN_FOR_PR }} FROM_BRANCH: "main" TO_BRANCH: "develop" - PULL_REQUEST_TITLE: "sync: ${{ github.ref_name || github.ref }} -> main -> develop" + PULL_REQUEST_TITLE: "sync: main -> develop" diff --git a/src/config/index.ts b/src/config/index.ts index c0b7a98..fdeb7cd 100644 --- a/src/config/index.ts +++ b/src/config/index.ts @@ -68,5 +68,6 @@ export default { /** * piickle service application url */ - webAppUrl: WEB_APP_URL as string + webAppUrl: WEB_APP_URL as string, + imageServerUrl: process.env.IMAGE_SERVER_URL as string }; diff --git a/src/controllers/userController.ts b/src/controllers/userController.ts index c159a35..68383c5 100644 --- a/src/controllers/userController.ts +++ b/src/controllers/userController.ts @@ -363,12 +363,15 @@ const updateUserProfileImage = async ( throw new IllegalArgumentException('필요한 값이 없습니다.'); } const image = req.file as Express.MulterS3.File; - const { location } = image; + const { key } = image; const userId = req.user?.id; if (!userId) { throw new IllegalArgumentException('로그인이 필요합니다.'); } - const data = await UserService.updateUserProfileImage(userId, location); + const data = await UserService.updateUserProfileImage( + userId, + `${config.imageServerUrl}/${key}` + ); return res .status(statusCode.OK) .send( diff --git a/src/intefaces/createUserCommand.ts b/src/intefaces/createUserCommand.ts index 441bcee..18ae2c2 100644 --- a/src/intefaces/createUserCommand.ts +++ b/src/intefaces/createUserCommand.ts @@ -1,3 +1,4 @@ +import config from '../config'; import { AgeGroup, AgeGroupKey } from '../models/user/ageGroup'; import { Gender, GenderKey } from '../models/user/gender'; import { TypedRequest } from '../types/TypedRequest'; @@ -28,7 +29,9 @@ const toCommand = (req: TypedRequest) => { ? AgeGroup[req.body.ageGroup] : AgeGroup.UNDEFINED, gender: req.body.gender ? Gender[req.body.gender] : Gender.ETC, - profileImgUrl: (req?.file as Express.MulterS3.File)?.location + profileImgUrl: `${config.imageServerUrl}/${ + (req?.file as Express.MulterS3.File)?.key + }` }; return createUserCommand; };