feat: translate backend
All checks were successful
Deploy Production Server / if_merged (pull_request) Successful in 7m23s
All checks were successful
Deploy Production Server / if_merged (pull_request) Successful in 7m23s
This commit is contained in:
@@ -63,6 +63,9 @@ public class ClubService {
|
||||
@Inject
|
||||
LoggerService ls;
|
||||
|
||||
@Inject
|
||||
TradService trad;
|
||||
|
||||
public SimpleClubModel findByIdOptionalClub(long id) throws Throwable {
|
||||
return VertxContextSupport.subscribeAndAwait(
|
||||
() -> Panache.withTransaction(() -> repository.findById(id).map(SimpleClubModel::fromModel)));
|
||||
@@ -130,7 +133,7 @@ public class ClubService {
|
||||
return combRepository.find("userId = ?1", securityCtx.getSubject()).firstResult()
|
||||
.invoke(Unchecked.consumer(m -> {
|
||||
if (m == null || m.getClub() == null)
|
||||
throw new DNotFoundException("Club non trouvé");
|
||||
throw new DNotFoundException(trad.t("club.non.trouve"));
|
||||
}))
|
||||
.map(MembreModel::getClub)
|
||||
.call(club -> Mutiny.fetch(club.getContact()));
|
||||
@@ -150,7 +153,7 @@ public class ClubService {
|
||||
return combRepository.find("userId = ?1", securityCtx.getSubject()).firstResult()
|
||||
.invoke(Unchecked.consumer(m -> {
|
||||
if (m == null || m.getClub() == null)
|
||||
throw new DNotFoundException("Club non trouvé");
|
||||
throw new DNotFoundException(trad.t("club.non.trouve"));
|
||||
if (!securityCtx.isInClubGroup(m.getClub().getId()))
|
||||
throw new DForbiddenException();
|
||||
}))
|
||||
@@ -166,7 +169,7 @@ public class ClubService {
|
||||
return combRepository.find("userId = ?1", securityCtx.getSubject()).firstResult()
|
||||
.invoke(Unchecked.consumer(m -> {
|
||||
if (m == null || m.getClub() == null)
|
||||
throw new DNotFoundException("Club non trouvé");
|
||||
throw new DNotFoundException(trad.t("club.non.trouve"));
|
||||
if (!securityCtx.isInClubGroup(m.getClub().getId()))
|
||||
throw new DForbiddenException();
|
||||
}))
|
||||
@@ -183,7 +186,7 @@ public class ClubService {
|
||||
ls.logUpdate("Contact(s)...", club);
|
||||
club.setContact(MAPPER.readValue(form.getContact(), typeRef));
|
||||
} catch (JsonProcessingException e) {
|
||||
throw new DBadRequestException("Erreur de format des contacts");
|
||||
throw new DBadRequestException(trad.t("erreur.de.format.des.contacts"));
|
||||
}
|
||||
|
||||
ls.logChange("Lieux d'entrainements", club.getTraining_location(), form.getTraining_location(),
|
||||
@@ -233,7 +236,7 @@ public class ClubService {
|
||||
ls.logUpdate("Contact(s)...", m);
|
||||
m.setContact(MAPPER.readValue(input.getContact(), typeRef));
|
||||
} catch (JsonProcessingException e) {
|
||||
throw new DBadRequestException("Erreur de format des contacts");
|
||||
throw new DBadRequestException(trad.t("erreur.de.format.des.contacts"));
|
||||
}
|
||||
}
|
||||
return Panache.withTransaction(() -> repository.persist(m)).call(() -> ls.append());
|
||||
|
||||
Reference in New Issue
Block a user