feat: add reject reason for affiliationRequest

This commit is contained in:
2025-07-04 17:24:51 +02:00
parent 97ca8766af
commit dea91714fa
3 changed files with 56 additions and 9 deletions

View File

@@ -102,12 +102,12 @@ public class AffiliationRequestEndpoints {
@APIResponse(responseCode = "404", description = "Demande d'affiliation non trouvée")
})
public Uni<?> getDelAffRequest(
@Parameter(description = "L'identifiant de la demande d'affiliation") @PathParam("id") long id) {
@Parameter(description = "L'identifiant de la demande d'affiliation") @PathParam("id") long id, @QueryParam("reason") String reason) {
return service.getRequest(id).invoke(Unchecked.consumer(o -> {
if (o.getClub() == null && !securityCtx.roleHas("federation_admin"))
throw new DForbiddenException();
})).invoke(o -> checkPerm.accept(o.getClub()))
.chain(o -> service.deleteReqAffiliation(id));
.chain(o -> service.deleteReqAffiliation(id, reason));
}
@PUT