Compare commits
No commits in common. "3d07a5bc8e9ca94ff19cdd31e3dd43f0ce5d7c25" and "412e661319590baf48d6ec3b2eb4f4d10eecfad9" have entirely different histories.
3d07a5bc8e
...
412e661319
@ -2,17 +2,8 @@ package fr.titionfire.ffsaf.data.repository;
|
||||
|
||||
import fr.titionfire.ffsaf.data.model.CheckoutModel;
|
||||
import io.quarkus.hibernate.reactive.panache.PanacheRepositoryBase;
|
||||
import io.smallrye.mutiny.Uni;
|
||||
import jakarta.enterprise.context.ApplicationScoped;
|
||||
|
||||
@ApplicationScoped
|
||||
public class CheckoutRepository implements PanacheRepositoryBase<CheckoutModel, Long> {
|
||||
|
||||
public Uni<Long> countByLicenseId(long id) {
|
||||
return getSession()
|
||||
.chain(s -> s
|
||||
.createNativeQuery("SELECT COUNT(*) FROM ffsaf__checkout WHERE ?1 = ANY(license_ids)", Long.class)
|
||||
.setParameter(1, id)
|
||||
.getSingleResult());
|
||||
}
|
||||
}
|
||||
|
||||
@ -58,7 +58,7 @@ public class CheckoutService {
|
||||
String organizationSlug;
|
||||
|
||||
public Uni<Boolean> canDeleteLicence(long id) {
|
||||
return repository.countByLicenseId(id).invoke(c -> System.out.println(c)).map(count -> count == 0);
|
||||
return repository.find("?1 IN licenseIds", id).count().map(count -> count == 0);
|
||||
}
|
||||
|
||||
public Uni<String> create(List<Long> ids, SecurityCtx securityCtx) {
|
||||
|
||||
@ -93,7 +93,7 @@ export function TextField({name, text, value, placeholder, type = "text", disabl
|
||||
<div className="input-group">
|
||||
<span className="input-group-text" id={name}>{text}</span>
|
||||
<input type={type} className="form-control" placeholder={placeholder ? placeholder : text} aria-label={name}
|
||||
name={name} aria-describedby={name} defaultValue={value} disabled={disabled} required={required} autoComplete="false"/>
|
||||
name={name} aria-describedby={name} defaultValue={value} disabled={disabled} required={required}/>
|
||||
</div>
|
||||
{ttip}
|
||||
</div>
|
||||
|
||||
@ -75,11 +75,11 @@ export function CompetitionRegisterAdmin({source}) {
|
||||
onClick={() => setModalState({id: 0})}>Ajouter un combattant
|
||||
</button>
|
||||
</div>
|
||||
{source === "admin" && <div className="mb-4">
|
||||
<div className="mb-4">
|
||||
<button type="button" className="btn btn-primary" data-bs-toggle="modal" data-bs-target="#registerModal"
|
||||
onClick={() => setModalState({id: -793548328091516928})}>Ajouter un invité
|
||||
</button>
|
||||
</div>}
|
||||
</div>
|
||||
<QuickAdd sendRegister={sendRegister} source={source}/>
|
||||
<div className="card mb-4">
|
||||
<div className="card-header">Filtre</div>
|
||||
@ -153,13 +153,7 @@ function SearchMember({sendRegister}) {
|
||||
}
|
||||
|
||||
sendRegister({
|
||||
licence: member.licence.trim(),
|
||||
fname: member.fname.trim(),
|
||||
lname: member.lname.trim(),
|
||||
weight: "",
|
||||
overCategory: 0,
|
||||
lockEdit: false,
|
||||
id: null
|
||||
licence: member.licence.trim(), fname: member.fname.trim(), lname: member.lname.trim(), weight: "", overCategory: 0, lockEdit: false, id: null
|
||||
})
|
||||
}
|
||||
|
||||
@ -359,9 +353,7 @@ function Modal({sendRegister, modalState, setModalState, source}) {
|
||||
<button type="button" className="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<div className="modal-body">
|
||||
{modalState.id < 0 &&
|
||||
<div className="mb-2">Les invités sont réservés aux membres non licenciés par la fédération. Les combattants inscrits via
|
||||
ce formulaire ne pourront pas voir leur résultat depuis leur profil.</div>}
|
||||
{modalState.id < 0 && <div className="mb-2">Les invités sont réservés aux membres non licenciés par la fédération. Les combattants inscrits via ce formulaire ne pourront pas voir leur résultat depuis leur profil.</div>}
|
||||
<div className="card" style={{marginBottom: "1em"}}>
|
||||
<div className="card-header">{modalState.id >= 0 ? "Recherche*" : "Information"}</div>
|
||||
<div className="card-body">
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user