fix: result on empty category
All checks were successful
Deploy Production Server / if_merged (pull_request) Successful in 6m45s

This commit is contained in:
Thibaut Valentin 2026-01-02 15:05:30 +01:00
parent 309f2a2268
commit 6d6324e1b4

View File

@ -115,13 +115,15 @@ public class ResultService {
public Uni<ResultCategoryData> getCategory(String uuid, long poule, SecurityCtx securityCtx) {
return hasAccess(uuid, securityCtx).chain(r ->
matchRepository.list("category.compet.uuid = ?1 AND category.id = ?2", uuid, poule)
.call(list -> Mutiny.fetch(list.get(0).getCategory().getTree()))
.call(list -> list.isEmpty() ? Uni.createFrom().voidItem() :
Mutiny.fetch(list.get(0).getCategory().getTree()))
.map(list -> getData(list, r.getMembre())));
}
public Uni<ResultCategoryData> getCategory(String uuid, long poule) {
return matchRepository.list("category.compet.uuid = ?1 AND category.id = ?2", uuid, poule)
.call(list -> Mutiny.fetch(list.get(0).getCategory().getTree()))
.call(list -> list.isEmpty() ? Uni.createFrom().voidItem() :
Mutiny.fetch(list.get(0).getCategory().getTree()))
.map(list -> getData(list, null));
}