fix: Autorisation des cross origin

This commit is contained in:
2026-09-23 12:44:57 +02:00
parent 561978e93f
commit 5c830c86ba
3 changed files with 6 additions and 1 deletions
@@ -4,6 +4,7 @@ import java.util.List;
import myapi.api.Model.Project; import myapi.api.Model.Project;
import myapi.api.Service.Interfaces.ProjectService; import myapi.api.Service.Interfaces.ProjectService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
@@ -18,6 +19,7 @@ import org.springframework.web.bind.annotation.RestController;
*/ */
@RestController @RestController
@RequestMapping("/project") @RequestMapping("/project")
@CrossOrigin
public class ProjectController { public class ProjectController {
@Autowired @Autowired
@@ -5,9 +5,9 @@ import myapi.api.Model.Task;
import myapi.api.Service.Interfaces.TaskService; import myapi.api.Service.Interfaces.TaskService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
@@ -20,6 +20,7 @@ import org.springframework.web.bind.annotation.RestController;
*/ */
@RestController @RestController
@RequestMapping("/task") @RequestMapping("/task")
@CrossOrigin
public class TaskController { public class TaskController {
@Autowired @Autowired
@@ -4,6 +4,7 @@ import java.util.List;
import myapi.api.Model.TaskGroup; import myapi.api.Model.TaskGroup;
import myapi.api.Service.Interfaces.TaskGroupService; import myapi.api.Service.Interfaces.TaskGroupService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
@@ -18,6 +19,7 @@ import org.springframework.web.bind.annotation.RestController;
*/ */
@RestController @RestController
@RequestMapping("/group") @RequestMapping("/group")
@CrossOrigin
public class TaskGroupController { public class TaskGroupController {
@Autowired @Autowired