Add reviews and support tutorial management

This commit is contained in:
Codex
2026-04-28 00:55:07 +08:00
parent 4e3fb17202
commit c8ccaa9925
78 changed files with 5231 additions and 858 deletions
@@ -26,6 +26,15 @@ const CACHE_PATHS = [
'/zh/support/warranty',
] as const
const CACHE_ROUTE_PATTERNS = [
'/en/downloads/[slug]',
'/zh/downloads/[slug]',
'/en/news/[slug]',
'/zh/news/[slug]',
'/en/products/[slug]',
'/zh/products/[slug]',
] as const
function normalizeReturnPath(value: FormDataEntryValue | null) {
if (typeof value !== 'string') return '/admin'
if (!value.startsWith('/admin')) return '/admin'
@@ -39,5 +48,9 @@ export async function clearFrontendCache(formData: FormData) {
revalidatePath(path)
}
for (const path of CACHE_ROUTE_PATTERNS) {
revalidatePath(path, 'page')
}
redirect(`${returnTo}${returnTo.includes('?') ? '&' : '?'}cache=cleared`)
}