Merge branch '11-add-api-for-getting-home-page-data' into 22-integrate-api-and-frontend
This commit is contained in:
commit
de0a027674
@ -54,23 +54,22 @@ public class DatasetController {
|
||||
@PutMapping("/id/{id}/upvote")
|
||||
public Dataset upvote(@PathVariable("id") UUID id) {
|
||||
datasetService.upvoteDataset(id);
|
||||
return null;
|
||||
return datasetService.getDatasetById(id);
|
||||
}
|
||||
|
||||
@PutMapping("/id/{id}/downvote")
|
||||
public Dataset downvote(@PathVariable("id") UUID id) {
|
||||
datasetService.downvoteDataset(id);
|
||||
return null; // new ResponseEntity<>(null, HttpStatus.OK);
|
||||
return getDatasetById(id); // new ResponseEntity<>(null, HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PutMapping("/id/{id}/vote")
|
||||
public String postMethodName(@PathVariable("id") UUID id,
|
||||
public Dataset postMethodName(@PathVariable("id") UUID id,
|
||||
@RequestParam("stars") int stars) {
|
||||
if (stars > 0 && stars < 6) {
|
||||
datasetService.voteDataset(id, stars);
|
||||
return null;
|
||||
}
|
||||
return "Invalid vote";
|
||||
return datasetService.getDatasetById(id);
|
||||
}
|
||||
|
||||
@GetMapping
|
||||
|
Loading…
Reference in New Issue
Block a user