fix: rm licence
All checks were successful
Deploy Production Server / if_merged (pull_request) Successful in 6m42s
All checks were successful
Deploy Production Server / if_merged (pull_request) Successful in 6m42s
This commit is contained in:
parent
bc72b7912c
commit
a730384d37
@ -2,8 +2,17 @@ package fr.titionfire.ffsaf.data.repository;
|
|||||||
|
|
||||||
import fr.titionfire.ffsaf.data.model.CheckoutModel;
|
import fr.titionfire.ffsaf.data.model.CheckoutModel;
|
||||||
import io.quarkus.hibernate.reactive.panache.PanacheRepositoryBase;
|
import io.quarkus.hibernate.reactive.panache.PanacheRepositoryBase;
|
||||||
|
import io.smallrye.mutiny.Uni;
|
||||||
import jakarta.enterprise.context.ApplicationScoped;
|
import jakarta.enterprise.context.ApplicationScoped;
|
||||||
|
|
||||||
@ApplicationScoped
|
@ApplicationScoped
|
||||||
public class CheckoutRepository implements PanacheRepositoryBase<CheckoutModel, Long> {
|
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;
|
String organizationSlug;
|
||||||
|
|
||||||
public Uni<Boolean> canDeleteLicence(long id) {
|
public Uni<Boolean> canDeleteLicence(long id) {
|
||||||
return repository.find("?1 IN licenseIds", id).count().map(count -> count == 0);
|
return repository.countByLicenseId(id).invoke(c -> System.out.println(c)).map(count -> count == 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Uni<String> create(List<Long> ids, SecurityCtx securityCtx) {
|
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">
|
<div className="input-group">
|
||||||
<span className="input-group-text" id={name}>{text}</span>
|
<span className="input-group-text" id={name}>{text}</span>
|
||||||
<input type={type} className="form-control" placeholder={placeholder ? placeholder : text} aria-label={name}
|
<input type={type} className="form-control" placeholder={placeholder ? placeholder : text} aria-label={name}
|
||||||
name={name} aria-describedby={name} defaultValue={value} disabled={disabled} required={required}/>
|
name={name} aria-describedby={name} defaultValue={value} disabled={disabled} required={required} autoComplete="false"/>
|
||||||
</div>
|
</div>
|
||||||
{ttip}
|
{ttip}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -75,11 +75,11 @@ export function CompetitionRegisterAdmin({source}) {
|
|||||||
onClick={() => setModalState({id: 0})}>Ajouter un combattant
|
onClick={() => setModalState({id: 0})}>Ajouter un combattant
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div className="mb-4">
|
{source === "admin" && <div className="mb-4">
|
||||||
<button type="button" className="btn btn-primary" data-bs-toggle="modal" data-bs-target="#registerModal"
|
<button type="button" className="btn btn-primary" data-bs-toggle="modal" data-bs-target="#registerModal"
|
||||||
onClick={() => setModalState({id: -793548328091516928})}>Ajouter un invité
|
onClick={() => setModalState({id: -793548328091516928})}>Ajouter un invité
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>}
|
||||||
<QuickAdd sendRegister={sendRegister} source={source}/>
|
<QuickAdd sendRegister={sendRegister} source={source}/>
|
||||||
<div className="card mb-4">
|
<div className="card mb-4">
|
||||||
<div className="card-header">Filtre</div>
|
<div className="card-header">Filtre</div>
|
||||||
@ -153,7 +153,13 @@ function SearchMember({sendRegister}) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
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
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -353,7 +359,9 @@ function Modal({sendRegister, modalState, setModalState, source}) {
|
|||||||
<button type="button" className="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
<button type="button" className="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||||
</div>
|
</div>
|
||||||
<div className="modal-body">
|
<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" style={{marginBottom: "1em"}}>
|
||||||
<div className="card-header">{modalState.id >= 0 ? "Recherche*" : "Information"}</div>
|
<div className="card-header">{modalState.id >= 0 ? "Recherche*" : "Information"}</div>
|
||||||
<div className="card-body">
|
<div className="card-body">
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user