From 10d40bea7c6a3fd07db7529ee08bb4d539729462 Mon Sep 17 00:00:00 2001 From: olexh Date: Sat, 22 Jun 2024 21:27:58 +0300 Subject: [PATCH] fix: remove no-store cache if config is provided --- services/api/config.ts | 3 --- services/api/fetchRequest.ts | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/services/api/config.ts b/services/api/config.ts index f7b2cd19..fd04c508 100644 --- a/services/api/config.ts +++ b/services/api/config.ts @@ -4,9 +4,6 @@ const config = { headers: { 'Content-type': 'application/json', }, - next: { - revalidate: 0, - }, }, }; diff --git a/services/api/fetchRequest.ts b/services/api/fetchRequest.ts index a00edd56..e1ba2ad9 100644 --- a/services/api/fetchRequest.ts +++ b/services/api/fetchRequest.ts @@ -61,7 +61,7 @@ export async function fetchRequest({ ? (params as FormData) : JSON.stringify(params) : undefined, - cache: 'no-store', + ...(myConfig ? {} : { cache: 'no-store' }), ...config.config, ...myConfig, headers: {