feat: add classement match system
This commit is contained in:
@@ -55,9 +55,9 @@ public class RMatch {
|
||||
return matchRepository.findById(id)
|
||||
.invoke(Unchecked.consumer(o -> {
|
||||
if (o == null)
|
||||
throw new DNotFoundException(trad.t("matche.non.trouver"));
|
||||
throw new DNotFoundException(trad.t("matche.non.trouver", connection));
|
||||
if (!o.getCategory().getCompet().getUuid().equals(connection.pathParam("uuid")))
|
||||
throw new DForbiddenException(trad.t("permission.denied"));
|
||||
throw new DForbiddenException(trad.t("permission.denied", connection));
|
||||
}));
|
||||
}
|
||||
|
||||
@@ -85,9 +85,9 @@ public class RMatch {
|
||||
return categoryRepository.findById(m.categorie)
|
||||
.invoke(Unchecked.consumer(o -> {
|
||||
if (o == null)
|
||||
throw new DNotFoundException(trad.t("categorie.non.trouver"));
|
||||
throw new DNotFoundException(trad.t("categorie.non.trouver", connection));
|
||||
if (!o.getCompet().getUuid().equals(connection.pathParam("uuid")))
|
||||
throw new DForbiddenException(trad.t("permission.denied"));
|
||||
throw new DForbiddenException(trad.t("permission.denied", connection));
|
||||
}))
|
||||
.chain(categoryModel -> creatMatch(categoryModel, m))
|
||||
.chain(mm -> Panache.withTransaction(() -> matchRepository.create(mm)))
|
||||
@@ -297,9 +297,9 @@ public class RMatch {
|
||||
return categoryRepository.findById(data.categorie)
|
||||
.invoke(Unchecked.consumer(o -> {
|
||||
if (o == null)
|
||||
throw new DNotFoundException(trad.t("categorie.non.trouver"));
|
||||
throw new DNotFoundException(trad.t("categorie.non.trouver", connection));
|
||||
if (!o.getCompet().getUuid().equals(connection.pathParam("uuid")))
|
||||
throw new DForbiddenException(trad.t("permission.denied"));
|
||||
throw new DForbiddenException(trad.t("permission.denied", connection));
|
||||
}))
|
||||
.call(cm -> data.matchesToRemove.isEmpty() ? Uni.createFrom().voidItem() :
|
||||
(Panache.withTransaction(
|
||||
|
||||
Reference in New Issue
Block a user