This commit is contained in:
Samandar Turgunboyev
2026-02-26 13:57:07 +05:00
parent f3a1b9efef
commit 5077c0d950

View File

@@ -2,7 +2,7 @@
import { AboutContent } from '@/features/about/ui/AboutContent'; import { AboutContent } from '@/features/about/ui/AboutContent';
import { AboutHero } from '@/features/about/ui/AboutHero'; import { AboutHero } from '@/features/about/ui/AboutHero';
import { PartnershipForm } from '@/features/about/ui/AboutPage'; 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'; import { Metadata } from 'next';
function getImageUrl(image?: string | null): string { 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; 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 fetchAboutData = async () => {
const res = await fetch(`${BASE_URL}${API_URLS.About}`, { const res = await fetch(
cache: 'no-store', // har doim yangi ma'lumot `https://api.gastro.felixits.uz/api/v1/shared/aboutus/`,
}); {
cache: 'no-store',
if (!res.ok) throw new Error('Failed to fetch about data'); },
const data = await res.json(); );
return data.banner; if (!res.ok) throw new Error(`Failed to fetch about data: ${res.status}`);
return res.json();
}; };
interface Props { interface Props {
params: { locale: 'uz' | 'ru' }; params: Promise<{ locale: 'uz' | 'ru' | 'en' }>;
} }
export async function generateMetadata({ params }: Props): Promise<Metadata> { export async function generateMetadata({ params }: Props): Promise<Metadata> {