fix(storefront): enforce cache no-store for apiFetch to ensure live CMS parity

This commit is contained in:
iFixKart Dev 2026-11-17 19:45:40 +05:30
parent d5d5cea64d
commit ef70c14efa
2 changed files with 3 additions and 0 deletions

View file

@ -116,3 +116,4 @@ export default function GlobalError({ error, reset }: GlobalErrorProps) {
</html> </html>
); );
} }

View file

@ -93,6 +93,7 @@ export async function apiFetch<T>(
try { try {
const response = await fetch(`${baseUrl}${endpoint}`, { const response = await fetch(`${baseUrl}${endpoint}`, {
cache: rest.cache ?? 'no-store',
...rest, ...rest,
headers, headers,
credentials: 'include', credentials: 'include',
@ -103,6 +104,7 @@ export async function apiFetch<T>(
if (refreshed) { if (refreshed) {
headers['Authorization'] = `Bearer ${getAccessToken()}`; headers['Authorization'] = `Bearer ${getAccessToken()}`;
const retryResponse = await fetch(`${baseUrl}${endpoint}`, { const retryResponse = await fetch(`${baseUrl}${endpoint}`, {
cache: rest.cache ?? 'no-store',
...rest, ...rest,
headers, headers,
credentials: 'include', credentials: 'include',