feat: implemented most of the backend api for administrator
Some checks failed
Format / formatting (push) Failing after 6s
CI / build (push) Successful in 11s

This commit is contained in:
Pierre Tellier
2025-02-26 14:29:38 +01:00
parent d8bc7cc9b6
commit 1cebebf1a5
11 changed files with 223 additions and 42 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);
}
}