fix merge bis
This commit is contained in:
parent
0ea451d9ea
commit
fbc5d83780
|
@ -121,7 +121,7 @@ public class MembreController {
|
||||||
|
|
||||||
//Efface un membre par son ID
|
//Efface un membre par son ID
|
||||||
@DeleteMapping(value = "/delete/{id}")
|
@DeleteMapping(value = "/delete/{id}")
|
||||||
@PreAuthorize("hasRole('ROLE_PARENT')")
|
//@PreAuthorize("hasRole('ROLE_PARENT')")
|
||||||
public ResponseEntity<?> deleteMembre(@PathVariable int id){
|
public ResponseEntity<?> deleteMembre(@PathVariable int id){
|
||||||
try {
|
try {
|
||||||
membreRepo.delete(membreRepo.getById(id));
|
membreRepo.delete(membreRepo.getById(id));
|
||||||
|
|
|
@ -33,7 +33,7 @@ public class TeamController {
|
||||||
|
|
||||||
// Récupération de toutes les teams
|
// Récupération de toutes les teams
|
||||||
@GetMapping(value = "/all")
|
@GetMapping(value = "/all")
|
||||||
@PreAuthorize("hasRole('ROLE_PARENT')")
|
//@PreAuthorize("hasRole('ROLE_PARENT')")
|
||||||
public ResponseEntity<?> getAllTeam(){
|
public ResponseEntity<?> getAllTeam(){
|
||||||
List<Team> liste = null;
|
List<Team> liste = null;
|
||||||
try
|
try
|
||||||
|
@ -61,7 +61,7 @@ public class TeamController {
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping(value="/add", produces="application/json", consumes="application/json")
|
@PostMapping(value="/add", produces="application/json", consumes="application/json")
|
||||||
@PreAuthorize("hasRole('ROLE_PARENT')")
|
//@PreAuthorize("hasRole('ROLE_PARENT')")
|
||||||
public ResponseEntity<?> addTeam(@RequestBody Team team){
|
public ResponseEntity<?> addTeam(@RequestBody Team team){
|
||||||
Team resultTeam = null;
|
Team resultTeam = null;
|
||||||
try {
|
try {
|
||||||
|
@ -74,7 +74,7 @@ public class TeamController {
|
||||||
}
|
}
|
||||||
|
|
||||||
@PutMapping("/update/{id}")
|
@PutMapping("/update/{id}")
|
||||||
@PreAuthorize("hasRole('ROLE_PARENT')")
|
//@PreAuthorize("hasRole('ROLE_PARENT')")
|
||||||
public ResponseEntity<?> updateTeam(@RequestBody Team team, @PathVariable Integer id) throws Exception {
|
public ResponseEntity<?> updateTeam(@RequestBody Team team, @PathVariable Integer id) throws Exception {
|
||||||
Team resultTeam = null;
|
Team resultTeam = null;
|
||||||
try {
|
try {
|
||||||
|
@ -88,7 +88,7 @@ public class TeamController {
|
||||||
}
|
}
|
||||||
|
|
||||||
@DeleteMapping(value = "/delete/{id}")
|
@DeleteMapping(value = "/delete/{id}")
|
||||||
@PreAuthorize("hasRole('ROLE_PARENT')")
|
//@PreAuthorize("hasRole('ROLE_PARENT')")
|
||||||
public ResponseEntity<?> deleteTeam(@PathVariable int id){
|
public ResponseEntity<?> deleteTeam(@PathVariable int id){
|
||||||
try {
|
try {
|
||||||
teamRepo.delete(teamRepo.getById(id));
|
teamRepo.delete(teamRepo.getById(id));
|
||||||
|
|
|
@ -36,7 +36,7 @@ public class Membre {
|
||||||
// @ManyToOne
|
// @ManyToOne
|
||||||
// @JoinColumn(name="TEAM_ID")
|
// @JoinColumn(name="TEAM_ID")
|
||||||
// @JsonIgnore
|
// @JsonIgnore
|
||||||
@ManyToOne(cascade = CascadeType.MERGE)
|
@ManyToOne
|
||||||
@JoinColumn(name="TEAM_ID")
|
@JoinColumn(name="TEAM_ID")
|
||||||
@JsonIgnoreProperties("membre")
|
@JsonIgnoreProperties("membre")
|
||||||
private Team team;
|
private Team team;
|
||||||
|
|
Loading…
Reference in New Issue