Skip to content

Commit b137ed3

Browse files
authored
Merge pull request #169 from umc-commit/fix/front-user-artist-google
2 parents 913ce24 + 6da3693 commit b137ed3

File tree

3 files changed

+18
-3
lines changed

3 files changed

+18
-3
lines changed

src/commission/repository/commission.repository.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,5 +342,17 @@ export const CommissionRepository = {
342342
});
343343

344344
return user?.nickname || null;
345+
},
346+
347+
// commission title 불러오기
348+
async findCommissionTitle(requestId){
349+
const row = await prisma.request.findUnique({
350+
where:{id:requestId},
351+
select:{
352+
commission:{select : {title:true}}
353+
}
354+
})
355+
356+
return row?.commission?.title ?? null;
345357
}
346358
}

src/common/swagger/user.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,9 @@
208208
"rate":{"type":"integer", "example":5},
209209
"content":{"type":"string", "example":"좋았습니다"},
210210
"createdAt":{"type":"string", "example":"2025-08-09T12:30:00.000Z"},
211-
"updatedAt":{"type":"string", "example":"2025-08-09T12:30:00.000Z"}
211+
"updatedAt":{"type":"string", "example":"2025-08-09T12:30:00.000Z"},
212+
"reviewThumbnail":{"type":"string", "example":"null"},
213+
"title":{"type":"string", "example":"낙서 타입 커미션"}
212214
}
213215
}
214216
}

src/user/service/user.service.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,9 +134,10 @@ export const UserService = {
134134
const reviewsThumbnailImage = await Promise.all(
135135
reviews.map(async (r) => {
136136
const images = await reviewRepository.getImagesByTarget("review", r.id);
137+
const title = await CommissionRepository.findCommissionTitle(r.requestId);
137138
const reviewThumbnail = images?.[0]?.imageUrl ?? null;
138139

139-
return {...r, reviewThumbnail}
140+
return {...r, reviewThumbnail, title}
140141
})
141142
)
142143

@@ -296,7 +297,7 @@ export const UserService = {
296297

297298
// 작가 팔로우 취소하기
298299
async CancelArtistFollow(accountId, artistId) {
299-
const artist = await UserRepository.findArtistById(artistId);
300+
const artist = await UserRepository.findArtistById(accountId);
300301

301302
if(!artist)
302303
throw new ArtistNotFound();

0 commit comments

Comments
 (0)