fix: club order

This commit is contained in:
Thibaut Valentin 2025-09-03 21:35:36 +02:00
parent ef528aa524
commit e86fe42b3d
2 changed files with 7 additions and 3 deletions

View File

@ -29,6 +29,7 @@ import org.eclipse.microprofile.openapi.annotations.responses.APIResponses;
import org.eclipse.microprofile.openapi.annotations.tags.Tag;
import java.net.URISyntaxException;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.function.Consumer;
@ -69,7 +70,8 @@ public class ClubEndpoints {
@APIResponse(responseCode = "500", description = "Erreur interne du serveur")
})
public Uni<List<SimpleClubModel>> getAll() {
return clubService.getAll().map(clubModels -> clubModels.stream().map(SimpleClubModel::fromModel).toList());
return clubService.getAll().map(clubModels -> clubModels.stream().map(SimpleClubModel::fromModel).sorted(
Comparator.comparing(SimpleClubModel::getName)).toList());
}
@GET

View File

@ -172,6 +172,7 @@ function InformationForm({data}) {
export function BureauCard({clubData}) {
const setLoading = useLoadingSwitcher()
const {data, error} = useFetch(`/club/desk/${clubData.id}`, setLoading, 1)
const navigate = useNavigate();
return <>
<div className="card mb-4">
@ -179,7 +180,8 @@ export function BureauCard({clubData}) {
<div className="card-body">
<ul className="list-group">
{data && data.map((d, index) => {
return <div key={index} className="list-group-item d-flex justify-content-between align-items-start">
return <div key={index} className="list-group-item d-flex justify-content-between align-items-start list-group-item-action"
onClick={__ => navigate(`/admin/member/${d.id}`)}>
<div className="me-auto"><small>{d.role}</small><br/>{d.lname} {d.fname}</div>
</div>
})}
@ -188,4 +190,4 @@ export function BureauCard({clubData}) {
</div>
{error && <AxiosError error={error}/>}
</>
}
}