another step

This commit is contained in:
hamid
2026-06-18 01:42:14 +03:30
parent e135b0b919
commit 6294cb4248
14 changed files with 70 additions and 101 deletions
+2 -1
View File
@@ -9,6 +9,7 @@ import { headers } from 'next/headers';
import { API_URL } from '@/config';
import { COOKIE_NAMES } from '@/lib/cookies';
import { HEADER_NAMES } from '@/constants';
import { getServerCookie } from '@/lib/cookies/server';
import { ApiError } from './errors';
@@ -26,7 +27,7 @@ export async function serverFetch<T>(path: string, options?: RequestInit): Promi
let locale = 'fa';
try {
const reqHeaders = await headers();
locale = reqHeaders.get('x-next-intl-locale') ?? 'fa';
locale = reqHeaders.get(HEADER_NAMES.LOCALE) ?? 'fa';
} catch {
// Outside request context (build-time prerendering) — use default locale
}