table hover fix

This commit is contained in:
Owen Rees
2023-06-19 23:17:21 +02:00
parent a4a0e0a669
commit ffbc8db21d
9 changed files with 98 additions and 34 deletions
+24
View File
@@ -0,0 +1,24 @@
import clientPromise from "@/lib/mongodb";
import { dateOrderingFrance } from "@/utils/dbDateOrdering";
/**
* Tournament data API endpoint
* @route /api/v1/tournaments/france
* @public
*/
export const revalidate = 3600; // revalidate cache every 6 hours
export async function GET() {
const headers = {
"Content-Type": "application/json",
};
try {
const client = await clientPromise;
const db = client.db("tournamentsFranceDB");
const data = await dateOrderingFrance(db);
return new Response(JSON.stringify(data), { status: 200, headers });
} catch (error) {
return new Response(JSON.stringify(error), { status: 500, headers });
}
}