Merged in fix/site-config-revalidate (pull request #1751)
fix: site-config - use correct cache keys and invalidate them * fix: site-config - use correct cache keys and invalidate them Approved-by: Joakim Jäderberg
This commit is contained in:
@@ -23,6 +23,7 @@ const validateJsonBody = z.object({
|
||||
data: z.object({
|
||||
content_type: z.object({
|
||||
uid: z.string(),
|
||||
content_type_uid: z.string(),
|
||||
}),
|
||||
entry: z.object({
|
||||
breadcrumbs: z
|
||||
@@ -90,6 +91,14 @@ export async function POST(request: NextRequest) {
|
||||
|
||||
const cacheClient = await getCacheClient()
|
||||
|
||||
const contentTypeUidTag = generateTag(
|
||||
entryLocale,
|
||||
content_type.content_type_uid
|
||||
)
|
||||
console.info(`Revalidating tag by content_type_uid: ${contentTypeUidTag}`)
|
||||
revalidateTag(contentTypeUidTag)
|
||||
await cacheClient.deleteKey(contentTypeUidTag, { fuzzy: true })
|
||||
|
||||
console.info(`Revalidating refsTag: ${refsTag}`)
|
||||
revalidateTag(refsTag)
|
||||
await cacheClient.deleteKey(refsTag, { fuzzy: true })
|
||||
|
||||
Reference in New Issue
Block a user