diff --git a/next-enterprise/src/app/actions.ts b/next-enterprise/src/app/actions.ts index 278d6ab..1acc5a8 100644 --- a/next-enterprise/src/app/actions.ts +++ b/next-enterprise/src/app/actions.ts @@ -1,12 +1,14 @@ 'use server' import type {SyncTag} from '@sanity/client' -import {expireTag} from 'next/cache' +import {revalidateTag} from 'next/cache' export async function randomColorTheme(tags: SyncTag[]) { const res = await fetch('https://lcapi-examples-api.sanity.dev/api/random-color-theme', { method: 'PUT', }) - expireTag(...tags) + for (const tag of tags) { + revalidateTag(tag) + } return res.json() }