diff --git a/src/app/[locale]/about/page.tsx b/src/app/[locale]/about/page.tsx index bbceec1..fa51865 100644 --- a/src/app/[locale]/about/page.tsx +++ b/src/app/[locale]/about/page.tsx @@ -2,7 +2,7 @@ import { AboutContent } from '@/features/about/ui/AboutContent'; import { AboutHero } from '@/features/about/ui/AboutHero'; import { PartnershipForm } from '@/features/about/ui/AboutPage'; -import { API_URLS, BASE_URL } from '@/shared/config/api/URLs'; +import { BASE_URL } from '@/shared/config/api/URLs'; import { Metadata } from 'next'; function getImageUrl(image?: string | null): string { @@ -10,19 +10,19 @@ function getImageUrl(image?: string | null): string { return image.includes(BASE_URL) ? image : BASE_URL + image; } -// ✅ axios emas, to'g'ridan-to'g'ri fetch — Next.js cache ni boshqaradi const fetchAboutData = async () => { - const res = await fetch(`${BASE_URL}${API_URLS.About}`, { - cache: 'no-store', // har doim yangi ma'lumot - }); - - if (!res.ok) throw new Error('Failed to fetch about data'); - const data = await res.json(); - return data.banner; + const res = await fetch( + `https://api.gastro.felixits.uz/api/v1/shared/aboutus/`, + { + cache: 'no-store', + }, + ); + if (!res.ok) throw new Error(`Failed to fetch about data: ${res.status}`); + return res.json(); }; interface Props { - params: { locale: 'uz' | 'ru' }; + params: Promise<{ locale: 'uz' | 'ru' | 'en' }>; } export async function generateMetadata({ params }: Props): Promise {