Compare commits
No commits in common. "6d6324e1b48a6b2c7820522ee039ef2df6b629f6" and "075f01a205fb0274f2322e1dbe7328487fdce0de" have entirely different histories.
6d6324e1b4
...
075f01a205
@ -115,15 +115,13 @@ public class ResultService {
|
|||||||
public Uni<ResultCategoryData> getCategory(String uuid, long poule, SecurityCtx securityCtx) {
|
public Uni<ResultCategoryData> getCategory(String uuid, long poule, SecurityCtx securityCtx) {
|
||||||
return hasAccess(uuid, securityCtx).chain(r ->
|
return hasAccess(uuid, securityCtx).chain(r ->
|
||||||
matchRepository.list("category.compet.uuid = ?1 AND category.id = ?2", uuid, poule)
|
matchRepository.list("category.compet.uuid = ?1 AND category.id = ?2", uuid, poule)
|
||||||
.call(list -> list.isEmpty() ? Uni.createFrom().voidItem() :
|
.call(list -> Mutiny.fetch(list.get(0).getCategory().getTree()))
|
||||||
Mutiny.fetch(list.get(0).getCategory().getTree()))
|
|
||||||
.map(list -> getData(list, r.getMembre())));
|
.map(list -> getData(list, r.getMembre())));
|
||||||
}
|
}
|
||||||
|
|
||||||
public Uni<ResultCategoryData> getCategory(String uuid, long poule) {
|
public Uni<ResultCategoryData> getCategory(String uuid, long poule) {
|
||||||
return matchRepository.list("category.compet.uuid = ?1 AND category.id = ?2", uuid, poule)
|
return matchRepository.list("category.compet.uuid = ?1 AND category.id = ?2", uuid, poule)
|
||||||
.call(list -> list.isEmpty() ? Uni.createFrom().voidItem() :
|
.call(list -> Mutiny.fetch(list.get(0).getCategory().getTree()))
|
||||||
Mutiny.fetch(list.get(0).getCategory().getTree()))
|
|
||||||
.map(list -> getData(list, null));
|
.map(list -> getData(list, null));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -292,30 +292,22 @@ public class RMatch {
|
|||||||
if (!o.getCompet().getUuid().equals(connection.pathParam("uuid")))
|
if (!o.getCompet().getUuid().equals(connection.pathParam("uuid")))
|
||||||
throw new DForbiddenException("Permission denied");
|
throw new DForbiddenException("Permission denied");
|
||||||
}))
|
}))
|
||||||
.invoke(m -> System.out.println("A00"))
|
.call(cm -> Panache.withTransaction(
|
||||||
.call(cm -> data.matchesToRemove.isEmpty() ? Uni.createFrom().voidItem() :
|
|
||||||
(Panache.withTransaction(
|
|
||||||
() -> matchRepository.delete("id IN ?1 AND category = ?2", data.matchesToRemove, cm))
|
() -> matchRepository.delete("id IN ?1 AND category = ?2", data.matchesToRemove, cm))
|
||||||
.call(__ -> SSMatch.sendDeleteMatch(connection, data.matchesToRemove))))
|
.call(__ -> SSMatch.sendDeleteMatch(connection, data.matchesToRemove)))
|
||||||
.invoke(m -> System.out.println("A0"))
|
|
||||||
.call(cm -> Panache.withSession(() -> matchRepository.list("id IN ?1 AND category = ?2",
|
.call(cm -> Panache.withSession(() -> matchRepository.list("id IN ?1 AND category = ?2",
|
||||||
Stream.concat(data.matchOrderToUpdate.keySet().stream(),
|
Stream.concat(data.matchOrderToUpdate.keySet().stream(),
|
||||||
data.matchPouleToUpdate.keySet().stream())
|
data.matchPouleToUpdate.keySet().stream())
|
||||||
.distinct().toList(), cm)
|
.distinct().toList(), cm)
|
||||||
.invoke(m -> System.out.println("A " + m.size()))
|
|
||||||
.invoke(matchModels -> matchModels.forEach(model -> {
|
.invoke(matchModels -> matchModels.forEach(model -> {
|
||||||
if (data.matchPouleToUpdate.containsKey(model.getId()))
|
if (data.matchPouleToUpdate.containsKey(model.getId()))
|
||||||
model.setPoule(data.matchPouleToUpdate.get(model.getId()));
|
model.setPoule(data.matchPouleToUpdate.get(model.getId()));
|
||||||
if (data.matchOrderToUpdate.containsKey(model.getId()))
|
if (data.matchOrderToUpdate.containsKey(model.getId()))
|
||||||
model.setCategory_ord(data.matchOrderToUpdate.get(model.getId()));
|
model.setCategory_ord(data.matchOrderToUpdate.get(model.getId()));
|
||||||
}))
|
}))
|
||||||
.invoke(m -> System.out.println("B " + m.size()))
|
.call(mm -> Panache.withTransaction(() -> matchRepository.persist(mm)))
|
||||||
.call(mm -> mm.isEmpty() ? Uni.createFrom().voidItem() :
|
|
||||||
Panache.withTransaction(() -> matchRepository.persist(mm)))
|
|
||||||
.invoke(m -> System.out.println("C"))
|
|
||||||
.invoke(mm -> matches.addAll(mm.stream().map(MatchEntity::fromModel).toList())))
|
.invoke(mm -> matches.addAll(mm.stream().map(MatchEntity::fromModel).toList())))
|
||||||
)
|
)
|
||||||
.invoke(m -> System.out.println("D"))
|
|
||||||
.chain(categoryModel -> {
|
.chain(categoryModel -> {
|
||||||
Uni<List<MatchModel>> uni = Uni.createFrom().item(new ArrayList<>());
|
Uni<List<MatchModel>> uni = Uni.createFrom().item(new ArrayList<>());
|
||||||
for (AddMatch match : data.newMatch)
|
for (AddMatch match : data.newMatch)
|
||||||
@ -324,11 +316,8 @@ public class RMatch {
|
|||||||
return Panache.withSession(() -> finalUni);
|
return Panache.withSession(() -> finalUni);
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
.invoke(m -> System.out.println("E"))
|
.chain(mm -> Panache.withTransaction(() -> matchRepository.create(mm))
|
||||||
.chain(mm -> mm.isEmpty() ? Uni.createFrom().voidItem() :
|
|
||||||
Panache.withTransaction(() -> matchRepository.create(mm))
|
|
||||||
.invoke(__ -> matches.addAll(mm.stream().map(MatchEntity::fromModel).toList())))
|
.invoke(__ -> matches.addAll(mm.stream().map(MatchEntity::fromModel).toList())))
|
||||||
.invoke(m -> System.out.println("F"))
|
|
||||||
.call(__ -> SSMatch.sendMatch(connection, matches))
|
.call(__ -> SSMatch.sendMatch(connection, matches))
|
||||||
.replaceWithVoid();
|
.replaceWithVoid();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -87,7 +87,7 @@ function CMTMatchPanel({catId, cat, menuActions}) {
|
|||||||
setLoading(1);
|
setLoading(1);
|
||||||
sendRequest('getFullCategory', catId)
|
sendRequest('getFullCategory', catId)
|
||||||
.then((data) => {
|
.then((data) => {
|
||||||
setTrees(data.trees.sort((a, b) => a.level - b.level).map(d => from_sendTree(d, true)))
|
setTrees(data.trees.map(d => from_sendTree(d, true)))
|
||||||
|
|
||||||
let matches2 = [];
|
let matches2 = [];
|
||||||
let combsToAdd = [];
|
let combsToAdd = [];
|
||||||
@ -101,7 +101,7 @@ function CMTMatchPanel({catId, cat, menuActions}) {
|
|||||||
const treeListener = ({data}) => {
|
const treeListener = ({data}) => {
|
||||||
if (data.length < 1 || data[0].categorie !== catId)
|
if (data.length < 1 || data[0].categorie !== catId)
|
||||||
return
|
return
|
||||||
setTrees(data.sort((a, b) => a.level - b.level).map(d => from_sendTree(d, true)))
|
setTrees(data.map(d => from_sendTree(d, true)))
|
||||||
|
|
||||||
let matches2 = [];
|
let matches2 = [];
|
||||||
let combsToAdd = [];
|
let combsToAdd = [];
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user