fix: map chinese language requests to zh-CN

This commit is contained in:
TerryM
2026-05-26 08:09:20 +08:00
parent e7a5952d58
commit f2e97c329e
7 changed files with 14 additions and 11 deletions

View File

@@ -54,7 +54,7 @@ export function AdminResourceForm() {
const [err, setErr] = useState<string | null>(null);
useEffect(() => {
getJSON<Category[]>("/api/categories?lang=zh")
getJSON<Category[]>("/api/categories?lang=zh-CN")
.then(setCats)
.catch(() => setCats([]));
}, []);

View File

@@ -32,7 +32,7 @@ export function AdminResources() {
const [total, setTotal] = useState(0);
useEffect(() => {
getJSON<Category[]>("/api/categories?lang=zh")
getJSON<Category[]>("/api/categories?lang=zh-CN")
.then((cats) => {
const m: Record<number, string> = {};
for (const c of cats) m[c.id] = c.name;