File tree Expand file tree Collapse file tree 3 files changed +10
-1
lines changed
Expand file tree Collapse file tree 3 files changed +10
-1
lines changed Original file line number Diff line number Diff line change 755755 "description" :{"type" :" string" , "example" :" 테스트용 작가입니다." },
756756 "profileImage" :{"type" : " string" , "example" :" https://example.com/artist1.png" },
757757 "slot" :{"type" : " integer" , "example" :3 },
758+ "followerCount" :{"type" :" integer" , "example" :3 },
758759 "reviews" :{
759760 "type" :" array" ,
760761 "items" :{
Original file line number Diff line number Diff line change @@ -326,6 +326,11 @@ export const UserRepository = {
326326 orderBy : { createdAt :"desc" } ,
327327 } ) ;
328328 } ,
329-
329+ // artistId로 팔로워 조회하기
330+ async CountArtistFollower ( artistId ) {
331+ return await prisma . follow . count ( {
332+ where :{ artistId :artistId } ,
333+ } )
334+ }
330335} ;
331336
Original file line number Diff line number Diff line change @@ -371,6 +371,8 @@ export const UserService = {
371371 async AccessArtistProfile ( artistId , accountId , userId ) {
372372 const profile = await UserRepository . AccessArtistProfile ( artistId ) ;
373373
374+ const followercount = await UserRepository . CountArtistFollower ( artistId ) ;
375+
374376 if ( ! profile )
375377 throw new ArtistNotFound ( ) ;
376378
@@ -441,6 +443,7 @@ export const UserService = {
441443
442444 return {
443445 ...profile ,
446+ followerCount : followercount ,
444447 reviews,
445448 commissions :commissionList ,
446449 badges
You can’t perform that action at this time.
0 commit comments