Merge branch 'backend-api' of ssh://gitea.piair.dev:2222/piair/MyINPulse into backend-api
All checks were successful
Format / formatting (push) Successful in 5s
CI / build (push) Successful in 11s

This commit is contained in:
Théo Le Lez
2025-02-26 14:51:52 +01:00
13 changed files with 190 additions and 83 deletions

View File

@ -26,8 +26,8 @@ public class AdminApi {
* @return a list of all project managed by the current admin user
*/
@GetMapping("/admin/projects")
public Iterable<Administrator> getProjects() {
return adminApiService.getProjects();
public Iterable<Project> getProjects(@AuthenticationPrincipal Jwt principal) {
return adminApiService.getProjectsOfAdmin(principal.getClaimAsString("email"));
}
/**
@ -53,7 +53,7 @@ public class AdminApi {
/**
* Endpoint used to make a decision about a project.
*
* <p>The decision must contains the administrator
* <p>The decision must contain the administrator
*
* @return the status code of the request
*/
@ -96,7 +96,7 @@ public class AdminApi {
* @return the status code of the request
*/
@DeleteMapping("/admin/projects/remove/{projectId}")
public void deleteProject(@PathVariable String projectId) {
public void deleteProject(@PathVariable long projectId) {
adminApiService.deleteProject(projectId);
}
}