File tree Expand file tree Collapse file tree 2 files changed +3
-4
lines changed
backend/src/main/java/es/codeurjc/wallypop Expand file tree Collapse file tree 2 files changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -32,9 +32,8 @@ public class ReportRestController {
32
32
@ PostMapping ("/{idArticle}" )
33
33
@ ResponseStatus (HttpStatus .CREATED )
34
34
public ResponseEntity <Report > createReport (@ PathVariable long idArticle ,@ RequestBody Report report ) {
35
- reportService .save (report );
36
- reportService .findById (report .getID_REPORT ()).get ().setARTICLE (articleService .findById (idArticle ).get ());
37
- reportService .flush ();
35
+ report .setARTICLE (articleService .findById (idArticle ).get ());
36
+ reportService .save (report );
38
37
return new ResponseEntity <>(report , HttpStatus .OK );
39
38
}
40
39
Original file line number Diff line number Diff line change 21
21
@ Entity
22
22
@ Table (name = "REPORT" )
23
23
//@JsonIdentityInfo(generator= ObjectIdGenerators.IntSequenceGenerator.class, property="@id_report")
24
- @ JsonIgnoreProperties (value = "article" )
24
+ // @JsonIgnoreProperties(value = "article")
25
25
public class Report {
26
26
27
27
@ Id
You can’t perform that action at this time.
0 commit comments