mirror of
https://github.com/TheRealOwenRees/echecsfrance.git
synced 2026-11-18 07:22:06 +00:00
Display a message when there are no results
This commit is contained in:
@@ -124,6 +124,10 @@ export const fetchTournamentResults = action(
|
||||
},
|
||||
);
|
||||
|
||||
if (rawResults.status >= 500) {
|
||||
throw new Error("ERR_TOURNAMENT_RESULTS_NOT_AVAILABLE");
|
||||
}
|
||||
|
||||
const results = await rawResults.json();
|
||||
|
||||
if ("detail" in results && results.detail === "Not found") {
|
||||
@@ -131,6 +135,7 @@ export const fetchTournamentResults = action(
|
||||
}
|
||||
|
||||
const parsedResults = dbSchema.parse(results);
|
||||
|
||||
return outputSchema.parse(
|
||||
parsedResults.map<z.infer<typeof outputSchema>[number]>((player) => ({
|
||||
id: player.id,
|
||||
|
||||
Reference in New Issue
Block a user