mirror of
https://github.com/TheRealOwenRees/echecsfrance.git
synced 2026-11-18 07:22:06 +00:00
upgrade Nodemailer to v10
fix dead code with knip upgrade TS to v6 and fix linting errors auto apply oxfmt rules fix linting errors - unused deps etc ignore file remove all ignored files in knip add knip - dead code analysis tool swap prettier and eslint of oxfmt and oxlint fix: fix map rendering in react strict mode fix: headlessUI float replace fix: disable Matomo if not URL and SITE ID exist upgrade: 1st pass upgrade to Next.js v16 deps: upgrade react to v19
This commit is contained in:
@@ -58,9 +58,7 @@ const getEloDetails = (elo: string | null) => {
|
||||
};
|
||||
};
|
||||
|
||||
const getResultDetails = (
|
||||
results: z.infer<typeof dbSchema>[number]["results"][number],
|
||||
) => {
|
||||
const getResultDetails = (results: z.infer<typeof dbSchema>[number]["results"][number]) => {
|
||||
if (results.opponent_name === null) {
|
||||
return { result: 0, lostByForfeit: true, wonByForfeit: false };
|
||||
}
|
||||
@@ -118,12 +116,9 @@ export const fetchTournamentResults = actionClient
|
||||
headers.append("api-key", apiKey);
|
||||
}
|
||||
|
||||
const rawResults = await fetch(
|
||||
`${process.env.RESULTS_SCRAPER_URL}${id}`,
|
||||
{
|
||||
headers: headers,
|
||||
},
|
||||
);
|
||||
const rawResults = await fetch(`${process.env.RESULTS_SCRAPER_URL}${id}`, {
|
||||
headers: headers,
|
||||
});
|
||||
|
||||
if (rawResults.status >= 500) {
|
||||
throw new Error("ERR_TOURNAMENT_RESULTS_NOT_AVAILABLE");
|
||||
@@ -143,12 +138,7 @@ export const fetchTournamentResults = actionClient
|
||||
name: player.name,
|
||||
...getEloDetails(player.elo),
|
||||
results: player.results.map((result) => ({
|
||||
colour:
|
||||
result.colour === "B"
|
||||
? "white"
|
||||
: result.colour === "N"
|
||||
? "black"
|
||||
: "",
|
||||
colour: result.colour === "B" ? "white" : result.colour === "N" ? "black" : "",
|
||||
opponent: result.opponent_name,
|
||||
...getResultDetails(result),
|
||||
...getEloDetails(result.opponent_elo),
|
||||
@@ -156,10 +146,7 @@ export const fetchTournamentResults = actionClient
|
||||
})),
|
||||
);
|
||||
} catch (error: any) {
|
||||
if (
|
||||
!("message" in error) ||
|
||||
error.message !== "ERR_TOURNAMENT_NOT_FOUND"
|
||||
) {
|
||||
if (!("message" in error) || error.message !== "ERR_TOURNAMENT_NOT_FOUND") {
|
||||
reportFetchError(id, error);
|
||||
errorLog(JSON.stringify(error, null, 2));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user