fix: closes #26
This commit is contained in:
parent
6b588cba8c
commit
ca2f67cb25
@ -54,23 +54,22 @@ public class DatasetController {
|
|||||||
@PutMapping("/id/{id}/upvote")
|
@PutMapping("/id/{id}/upvote")
|
||||||
public Dataset upvote(@PathVariable("id") UUID id) {
|
public Dataset upvote(@PathVariable("id") UUID id) {
|
||||||
datasetService.upvoteDataset(id);
|
datasetService.upvoteDataset(id);
|
||||||
return null;
|
return datasetService.getDatasetById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@PutMapping("/id/{id}/downvote")
|
@PutMapping("/id/{id}/downvote")
|
||||||
public Dataset downvote(@PathVariable("id") UUID id) {
|
public Dataset downvote(@PathVariable("id") UUID id) {
|
||||||
datasetService.downvoteDataset(id);
|
datasetService.downvoteDataset(id);
|
||||||
return null; // new ResponseEntity<>(null, HttpStatus.OK);
|
return getDatasetById(id); // new ResponseEntity<>(null, HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
@PutMapping("/id/{id}/vote")
|
@PutMapping("/id/{id}/vote")
|
||||||
public String postMethodName(@PathVariable("id") UUID id,
|
public Dataset postMethodName(@PathVariable("id") UUID id,
|
||||||
@RequestParam("stars") int stars) {
|
@RequestParam("stars") int stars) {
|
||||||
if (stars > 0 && stars < 6) {
|
if (stars > 0 && stars < 6) {
|
||||||
datasetService.voteDataset(id, stars);
|
datasetService.voteDataset(id, stars);
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
return "Invalid vote";
|
return datasetService.getDatasetById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping
|
@GetMapping
|
||||||
|
Loading…
Reference in New Issue
Block a user