fix(storefront): enforce cache no-store for apiFetch to ensure live CMS parity
This commit is contained in:
parent
d5d5cea64d
commit
ef70c14efa
2 changed files with 3 additions and 0 deletions
|
|
@ -116,3 +116,4 @@ export default function GlobalError({ error, reset }: GlobalErrorProps) {
|
||||||
</html>
|
</html>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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',
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue