fix: update news fetching endpoint and adjust NewsItem schema for nullable URL

This commit is contained in:
AlexBesios
2026-04-08 15:52:24 +03:00
parent dbaa61318e
commit 7bc16f235e
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -269,7 +269,7 @@ export async function fetchPlayerLeaderboard(
export async function getNews(): Promise<NewsItem[]> {
try {
const res = await fetch(`${getApiBase()}/news`, {
const res = await fetch(`${getApiBase()}/news.json`, {
headers: { Accept: "application/json" },
});
if (res.status !== 200) {
+1 -1
View File
@@ -196,7 +196,7 @@ export const NewsItemSchema = z.object({
id: z.string(),
title: z.string(),
description: z.string(),
url: z.string().optional(),
url: z.string().nullable().optional(),
type: z.enum(["tournament", "tutorial", "announcement"]),
});
export type NewsItem = z.infer<typeof NewsItemSchema>;