Sort clubs

This commit is contained in:
Timothy Armes
2023-10-10 10:01:15 +02:00
parent ed68a9280b
commit bd0993ed72
+5 -1
View File
@@ -12,7 +12,11 @@ const getClubs = async () => {
try {
const client = await clientPromise;
const db = client.db("tournamentsFranceDB");
const data = await db.collection("clubs").find<ClubData>({}).toArray();
const data = await db
.collection("clubs")
.find<ClubData>({})
.sort({ name: 1 })
.toArray();
return data
.filter((c) => !!c.coordinates)