refactor: update translation API and improve footer component logic

This commit is contained in:
“hyeonggkim”
2025-10-27 16:06:32 +09:00
parent 4a2083eb42
commit 641988b033
3 changed files with 73 additions and 46 deletions

View File

@@ -0,0 +1,22 @@
interface ReqApiData {
baseApiUrl: string
url: string
}
export const useApiData = async (req: ReqApiData): Promise<any> => {
const dataUrl = `${req.baseApiUrl}/${req.url}` // 정상 URL 경로
try {
const fetch = await $fetch<any>(dataUrl, {
method: 'GET',
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})
return fetch
} catch (error) {
console.log('error', error)
return []
}
}