File tree Expand file tree Collapse file tree 2 files changed +3
-0
lines changed
Shared/DataTransferObject/OutputDto Expand file tree Collapse file tree 2 files changed +3
-0
lines changed Original file line number Diff line number Diff line change @@ -43,11 +43,13 @@ public async Task<IEnumerable<PostDto>> GetAllPost(bool trackChanges)
43
43
public async Task < PostPostPhotoDto > GetPost ( int postId , bool trackChanges )
44
44
{
45
45
var post = await _repository . Post . GetPostById ( postId , trackChanges ) ;
46
+ int likeNum = await _repository . Like . GetLikeCountByPostId ( postId , trackChanges ) ;
46
47
47
48
if ( post is null )
48
49
throw new PostNotFoundException ( postId ) ;
49
50
50
51
var postDto = _mapper . Map < PostPostPhotoDto > ( post ) ;
52
+ postDto . LikeCount = likeNum ;
51
53
52
54
return postDto ;
53
55
}
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ public class PostPostPhotoDto
14
14
public double ? x { get ; set ; }
15
15
public double ? y { get ; set ; }
16
16
public ICollection < PostPhotoDto > PostPhotos { get ; set ; }
17
+ public int LikeCount { get ; set ; }
17
18
public DateTime ? UpdateDate { get ; set ; }
18
19
public DateTime ? CreatedDate { get ; set ; }
19
20
}
You can’t perform that action at this time.
0 commit comments