diff --git a/src/app/(root)/(routes)/(home)/components/TestBlock.tsx b/src/app/(root)/(routes)/(home)/components/TestBlock.tsx index 4cc2b403..9fa957f3 100644 --- a/src/app/(root)/(routes)/(home)/components/TestBlock.tsx +++ b/src/app/(root)/(routes)/(home)/components/TestBlock.tsx @@ -1,16 +1,19 @@ // 'use client' -import React, { useEffect } from 'react' +import React from 'react' import { getTest } from '@/services/test/test' async function getTestValue() { - const res = await getTest() - const data = await res.json() - return data + try { + const res = await getTest() + const data = await res.json() + return data + } catch (e) { + console.log(e) + } } export default async function TestBlock() { const data = await getTestValue() - console.log(data.message) // useEffect(() => { // async function fetchData() { @@ -20,5 +23,5 @@ export default async function TestBlock() { // fetchData() // }, []) - return
{'index ' + data.message}
+ return
{'index ' + data?.message}
}