diff --git a/ui/src/app/page.js b/ui/src/app/page.js
index 124afff..51af997 100644
--- a/ui/src/app/page.js
+++ b/ui/src/app/page.js
@@ -36,12 +36,14 @@ const fetchCounter = async () => {
throw new Error("Failed to fetch data");
}
+ /** @type {CounterApiResponse} */
const data = await response.json();
if (!data) {
throw new Error("Invalid response data");
}
+ /** @type {Counter} */
const result = {
currentValue: data.CurrentValue,
updatedAt: data.UpdatedAt,
@@ -52,7 +54,7 @@ const fetchCounter = async () => {
};
return result;
} catch (error) {
- console.error("Error fetching the current value:", error.message);
+ /** @type {Counter} */
return {
currentValue: null,
updatedAt: null,
@@ -69,6 +71,7 @@ const fetchCounter = async () => {
* @returns {JSX.Element} The Home component.
*/
const Home = async () => {
+ /** @type {Counter} */
const data = await fetchCounter();
return (
@@ -78,7 +81,11 @@ const Home = async () => {