From 3a579cc3e3d2533db29a1528b36683fd681086b0 Mon Sep 17 00:00:00 2001 From: Cody Olsen Date: Thu, 21 Nov 2024 16:35:13 +0100 Subject: [PATCH] Update actions.ts --- next-enterprise/src/app/actions.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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() }