Skip to content

Commit

Permalink
more debugging logging
Browse files Browse the repository at this point in the history
  • Loading branch information
kahlstrm committed Jan 23, 2024
1 parent bfbdc12 commit fb0e691
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions apps/web/src/lib/api/fetcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ export const fetcher =
if (isDraftMode) {
payloadToken = cookies().get("payload-token");
}

const tagToCache =
tag(req) + (isDraftMode && payloadToken ? `_${Date.now()}` : "");
// eslint-disable-next-line no-console -- for debugging purposes
console.log("tagToCache", tagToCache);
const res = await dataFetcher(
req,
Boolean(isDraftMode) && Boolean(payloadToken),
Expand All @@ -29,9 +32,7 @@ export const fetcher =
// we do this by calling `revalidateTag()` using the same key
// see `app/api/revalidate.ts` for more info
next: {
tags: [
tag(req) + (isDraftMode && payloadToken ? `_${Date.now()}` : ""),
],
tags: [tagToCache],
},
...(isDraftMode && payloadToken
? {
Expand Down

0 comments on commit fb0e691

Please sign in to comment.