feat: club remove

This commit is contained in:
2024-07-16 22:08:02 +02:00
parent 6407bf44bc
commit f297ae557b
11 changed files with 165 additions and 38 deletions

View File

@@ -159,8 +159,15 @@ public class ClubEndpoints {
@GET
@Path("{id}/status")
@RolesAllowed({"federation_admin", "club_president", "club_secretaire"})
public Uni<Response> getStatus(@PathParam("id") long id) throws URISyntaxException {
return Utils.getMediaFile(id, media, "clubStatus", clubService.getById(id).onItem().invoke(checkPerm));
public Uni<Response> getStatus(@PathParam("id") long id) {
return clubService.getById(id).onItem().invoke(checkPerm).chain(Unchecked.function(clubModel -> {
try {
return Utils.getMediaFile(clubModel.getId(), media, "clubStatus",
"statue-" + clubModel.getName() + ".pdf", Uni.createFrom().nullItem());
} catch (URISyntaxException e) {
throw new InternalError();
}
}));
}
}