Skip to content

Commit fda4ea7

Browse files
authored
Merge pull request #40 from CodeURJC-DAW-2021-22/develop
Develop to main
2 parents 08bca52 + 10b594b commit fda4ea7

File tree

2 files changed

+3
-13
lines changed

2 files changed

+3
-13
lines changed

backend/src/main/java/es/codeurjc/wallypop/controller/api/ReportRestController.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
@RequestMapping("/api/reports")
2020
public class ReportRestController {
2121

22+
2223
@Autowired
2324
private ReportService reportService;
2425
@Autowired
@@ -44,5 +45,4 @@ public ResponseEntity<Object> uploadImage(@PathVariable long id, @RequestParam M
4445
return ResponseEntity.created(location).build();
4546
}
4647

47-
4848
}

backend/src/main/java/es/codeurjc/wallypop/controller/api/admin/AdminReportRestController.java

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public ResponseEntity<Object> downloadReporteProof(@PathVariable long id) throws
5353

5454
Resource file = new InputStreamResource(report.getPROOF().getBinaryStream());
5555

56-
return ResponseEntity.ok().header(HttpHeaders.CONTENT_TYPE, "image/jpeg")
56+
return ResponseEntity.ok().header(HttpHeaders.CONTENT_TYPE, "application/zip")
5757
.contentLength(report.getPROOF().length()).body(file);
5858

5959
} else {
@@ -89,16 +89,6 @@ public ResponseEntity<Object> downloadReportedArticleImage(@PathVariable long id
8989
}
9090
}
9191

92-
@PutMapping("/{idReport}")
93-
public ResponseEntity<Report> updateReport(@PathVariable long idReport, @RequestBody Report updatedReport) throws SQLException {
94-
if (reportService.exist(idReport)) {
95-
reportService.updateReport(idReport, updatedReport);
96-
return new ResponseEntity<>(reportService.findById(idReport).get(), HttpStatus.OK);
97-
} else {
98-
return new ResponseEntity<>(HttpStatus.NOT_FOUND);
99-
}
100-
}
101-
10292
@DeleteMapping("/{id}/rejectReport")
10393
public ResponseEntity<Report> deleteReport(@PathVariable long id) {
10494

@@ -112,7 +102,7 @@ public ResponseEntity<Report> deleteReport(@PathVariable long id) {
112102

113103
}
114104

115-
@DeleteMapping("/{id}/acceptReport")
105+
@DeleteMapping("/{id}/aceptReport")
116106
public ResponseEntity<Article> deleteArticleReported(@PathVariable long id) {
117107

118108
try {

0 commit comments

Comments
 (0)