feat(core): update

This commit is contained in:
2026-06-21 20:20:20 +03:30
parent 4d995a61af
commit 58b027813d
15 changed files with 232 additions and 113 deletions

23
lib/content.js Normal file
View File

@@ -0,0 +1,23 @@
export async function getPublicContent(lang) {
const id = lang === 'fa' ? 1 : 2
const baseUrl = process.env.NEXT_PUBLIC_API_BASE_URL
if (!baseUrl) {
console.error('NEXT_PUBLIC_API_BASE_URL is not set')
return {}
}
try {
const res = await fetch(`${baseUrl}/api/public/content/index/${id}`)
if (!res.ok) {
console.error(`Failed to fetch public content: ${res.status}`)
return {}
}
return res.json()
} catch (error) {
console.error('Failed to fetch public content', error)
return {}
}
}