Skip to content
Merged
Show file tree
Hide file tree
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
12 changes: 12 additions & 0 deletions src/commission/repository/commission.repository.js
Original file line number Diff line number Diff line change
Expand Up @@ -342,5 +342,17 @@ export const CommissionRepository = {
});

return user?.nickname || null;
},

// commission title 불러오기
async findCommissionTitle(requestId){
const row = await prisma.request.findUnique({
where:{id:requestId},
select:{
commission:{select : {title:true}}
}
})

return row?.commission?.title ?? null;
}
}
4 changes: 3 additions & 1 deletion src/common/swagger/user.json
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,9 @@
"rate":{"type":"integer", "example":5},
"content":{"type":"string", "example":"좋았습니다"},
"createdAt":{"type":"string", "example":"2025-08-09T12:30:00.000Z"},
"updatedAt":{"type":"string", "example":"2025-08-09T12:30:00.000Z"}
"updatedAt":{"type":"string", "example":"2025-08-09T12:30:00.000Z"},
"reviewThumbnail":{"type":"string", "example":"null"},
"title":{"type":"string", "example":"낙서 타입 커미션"}
}
}
}
Expand Down
5 changes: 3 additions & 2 deletions src/user/service/user.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,10 @@ export const UserService = {
const reviewsThumbnailImage = await Promise.all(
reviews.map(async (r) => {
const images = await reviewRepository.getImagesByTarget("review", r.id);
const title = await CommissionRepository.findCommissionTitle(r.requestId);
const reviewThumbnail = images?.[0]?.imageUrl ?? null;

return {...r, reviewThumbnail}
return {...r, reviewThumbnail, title}
})
)

Expand Down Expand Up @@ -296,7 +297,7 @@ export const UserService = {

// 작가 팔로우 취소하기
async CancelArtistFollow(accountId, artistId) {
const artist = await UserRepository.findArtistById(artistId);
const artist = await UserRepository.findArtistById(accountId);

if(!artist)
throw new ArtistNotFound();
Expand Down