Merge branch '11-add-api-for-getting-home-page-data' into 22-integrate-api-and-frontend
This commit is contained in:
		@@ -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
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user