Skip to content
This repository was archived by the owner on Jun 28, 2025. It is now read-only.

Commit 8576c0d

Browse files
author
Manuel Proß
committed
refactor(web): add type assertion directly to json transformation
1 parent 00e46ee commit 8576c0d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

web/src/helpers/homepage.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ export async function getNews(count: number = 5): Promise<NewsCollection> {
6464
throw new Error("Fetching news failed");
6565
}
6666

67-
const news = await response.json();
67+
const news = (await response.json()) as NewsCollection;
6868
news.type = "News";
6969

70-
return news as NewsCollection;
70+
return news;
7171
}

0 commit comments

Comments
 (0)