Skip to content

Commit

Permalink
Fixed highlights page
Browse files Browse the repository at this point in the history
  • Loading branch information
This-Is-Ko committed Sep 23, 2024
1 parent a24d30f commit 30396ac
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ public interface PostRepository extends CrudRepository<Post, Integer> {

List<Post> findAllByOrderByDateGeneratedDesc(Pageable pageable);

List<Post> findAllByOrderByDateGeneratedAsc(Pageable pageable);

List<Post> findByPostedStatus(boolean postedStatus);

List<Post> findByPostedStatusOrderByDateGeneratedDesc(boolean postedStatus, Pageable pageable);

@Modifying
@Query("update Post p set p.postedStatus = :postedStatus where p.id = :id")
void updatePostSetPostedStatusForId(@Param("postedStatus") boolean postedStatus, @Param("id") int id);


}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class PerformanceAnalysisService {
private PostRepository postRepository;

public Map<Post, Map<String, Integer>> checkMatchPerformances() {
List<Post> recentPosts = postRepository.findAllByOrderByDateGeneratedDesc(PageRequest.of(1, 10));
List<Post> recentPosts = postRepository.findAllByOrderByDateGeneratedDesc(PageRequest.of(0, 20));

Map<Post, Map<String, Integer>> postsWithHighlights = new HashMap<>();
// Check stats in each recent post for highlights
Expand Down Expand Up @@ -61,5 +61,4 @@ public Map<String, Integer> checkHighlightsInMatch(Post post) {
}
return highlights;
}

}

0 comments on commit 30396ac

Please sign in to comment.