fix: map chinese language requests to zh-CN
This commit is contained in:
@@ -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([]));
|
||||
}, []);
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user