Skip to content

Commit 9bc444b

Browse files
authored
Merge pull request #164 from umc-commit/fix/front-user-artist-google
REFACTOR : 작가 프로필 조회에서 commission_image 썸네일 불러오기 부분 코드 수정 + 카카오 redirect 수정
2 parents ecc3777 + a057fb8 commit 9bc444b

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

src/auth.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export const kakaoStrategy = new KakaoStrategy(
5454
{
5555
clientID: process.env.PASSPORT_KAKAO_CLIENT_ID,
5656
clientSecret: process.env.PASSPORT_KAKAO_CLIENT_SECRET,
57-
callbackURL: "http://localhost:3000/api/users/oauth2/callback/kakao",
57+
callbackURL: `${process.env.BASE_URL}/api/users/oauth2/callback/google`,
5858
scope: undefined,
5959
state: true,
6060
},

src/common/swagger/user.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -762,6 +762,7 @@
762762
"createdAt" :{"type":"string", "example": "2025-08-04T02:31:36.000Z"},
763763
"commissionTitle":{"type":"string", "example":"테스트 커미션 글"},
764764
"workingTime":{"type":"string", "example":"33일"},
765+
"review_thumbnail":{"type":"string", "example":"https://example.com/reviewThumbnail1.png"},
765766
"writer":{
766767
"type":"object",
767768
"properties":{
@@ -785,6 +786,7 @@
785786
"items":{"type":"string"},
786787
"example":["감성", "낙서"]
787788
},
789+
"bookmark":{"type":"boolean", "example":false,
788790
"commission_img":{"type":"string", "example":"http://example.com/image.jpg"}
789791
}
790792
}
@@ -846,5 +848,5 @@
846848
}
847849
}
848850
}
849-
851+
}
850852

src/user/service/user.service.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -384,19 +384,19 @@ export const UserService = {
384384
createdAt: r.createdAt,
385385
commissionTitle: r.request.commission.title,
386386
workingTime: workingTime,
387+
review_thumbnail: images.length > 0 ? images[0] : null,
387388
writer: {
388389
nickname: r.user.nickname
389390
},
390-
reviewImage: images
391-
};
392-
})
391+
};
392+
})
393393
);
394394

395395
// 작가가 등록한 커미션 목록
396396
const commissions = await UserRepository.FetchArtistCommissions(artistId, userId);
397397
const commissionList = await Promise.all(
398398
commissions.map(async (c) => {
399-
const images = await CommissionRepository.findImagesByCommissionId(c.id); // c.id == targetId
399+
const images = await CommissionRepository.findThumbnailImageByCommissionId(c.id); // c.id == targetId
400400

401401
return {
402402
id: c.id,
@@ -407,7 +407,7 @@ export const UserService = {
407407
tags: c.commissionTags.map(t => t.tag.name),
408408
thumbnail: c.thumbnailImage,
409409
bookmark: c.bookmarks.length > 0,
410-
commission_img: images.length > 0 ? images[0].url : null // 첫 번째 이미지를 대표로
410+
commission_img: images?.imageUrl ?? null
411411
};
412412
})
413413
);

0 commit comments

Comments
 (0)