Przeglądaj źródła

readme tweaks again

Mitch Taylor 8 lat temu
rodzic
commit
3368b126ec

+ 2
- 2
README.md Wyświetl plik

@@ -312,7 +312,7 @@ public interface VoteRepository extends CrudRepository<Vote, Long> {
312 312
             "FROM Option o, Vote v " +
313 313
             "WHERE o.POLL_ID = ?1 " +
314 314
             "AND v.OPTION_ID = o.OPTION_ID", nativeQuery = true)
315
-    public Iterable<Vote> findVotesByPoll(Long pollId);
315
+    Iterable<Vote> findVotesByPoll(Long pollId);
316 316
 }
317 317
 ```
318 318
 
@@ -338,7 +338,7 @@ public Iterable<Vote> getAllVotes() {
338 338
 ```java
339 339
 @RequestMapping(value="/polls/{pollId}/votes", method=RequestMethod.GET)
340 340
 public Iterable<Vote> getVote(@PathVariable Long pollId) {
341
-	return voteRepository.findById(pollId);
341
+	return voteRepository.findVotesByPoll(pollId);
342 342
 }
343 343
 ```
344 344
 

+ 1
- 1
src/main/java/io/zipcoder/tc_spring_poll_application/controller/VoteController.java Wyświetl plik

@@ -34,7 +34,7 @@ public class VoteController {
34 34
 
35 35
     @RequestMapping(value="/polls/{pollId}/votes", method=RequestMethod.GET)
36 36
     public Iterable<Vote> getVote(@PathVariable Long pollId) {
37
-        return voteRepository.findById(pollId);
37
+        return voteRepository.findVotesByPoll(pollId);
38 38
     }
39 39
 
40 40
 }

+ 1
- 1
src/main/java/io/zipcoder/tc_spring_poll_application/repositories/VoteRepository.java Wyświetl plik

@@ -9,5 +9,5 @@ public interface VoteRepository extends CrudRepository<Vote, Long> {
9 9
             "FROM Option o, Vote v " +
10 10
             "WHERE o.POLL_ID = ?1 " +
11 11
             "AND v.OPTION_ID = o.OPTION_ID", nativeQuery = true)
12
-    public Iterable<Vote> findVotesByPoll(Long pollId);
12
+    Iterable<Vote> findVotesByPoll(Long pollId);
13 13
 }