Skip to content

Commit 09e8ccb

Browse files
author
du yeong
committed
찐막
1 parent 7927896 commit 09e8ccb

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

server/src/main/java/com/project/Glog/service/GitHubService.java

+6-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import org.springframework.web.util.UriComponentsBuilder;
1717

1818
import java.util.*;
19+
import java.util.stream.Collectors;
1920

2021
@Service
2122
public class GitHubService {
@@ -182,7 +183,11 @@ public PrUnPostResponse saveAndGetPr(List<PrInfo> prInfos, GithubRepository gith
182183
}
183184

184185
List<PrPost> pr = prPostRepository.findByRepo(githubRepository.getId());
185-
PrUnPostedDtos prUnPostedDtos = new PrUnPostedDtos(pr);
186+
List<PrPost> unPostedPr = pr.stream()
187+
.filter(prPost -> prPost.getIsPosted().equals(0))
188+
.collect(Collectors.toList());
189+
190+
PrUnPostedDtos prUnPostedDtos = new PrUnPostedDtos(unPostedPr);
186191
Boolean isAuthor;
187192
if(categoryRepository.findUserByCategoryId(categoryId).getId() == user.getId()){
188193
isAuthor = true;

0 commit comments

Comments
 (0)