feat: align frontend languages with posts api
This commit is contained in:
@@ -17,6 +17,7 @@ import { useAdminRouterMode } from "../../adminRouterMode";
|
||||
const types = [
|
||||
"image",
|
||||
"video",
|
||||
"music",
|
||||
"ppt",
|
||||
"pdf",
|
||||
"text",
|
||||
@@ -36,7 +37,7 @@ export function AdminResourceForm() {
|
||||
const [title, setTitle] = useState("");
|
||||
const [description, setDescription] = useState("");
|
||||
const [rtype, setRtype] = useState<string>("image");
|
||||
const [language, setLanguage] = useState("zh-TW");
|
||||
const [language, setLanguage] = useState("zh");
|
||||
const [categoryId, setCategoryId] = useState(1);
|
||||
const [coverImage, setCoverImage] = useState("");
|
||||
const [fileUrl, setFileUrl] = useState("");
|
||||
@@ -53,7 +54,7 @@ export function AdminResourceForm() {
|
||||
const [err, setErr] = useState<string | null>(null);
|
||||
|
||||
useEffect(() => {
|
||||
getJSON<Category[]>("/api/categories?lang=zh-TW")
|
||||
getJSON<Category[]>("/api/categories?lang=zh")
|
||||
.then(setCats)
|
||||
.catch(() => setCats([]));
|
||||
}, []);
|
||||
@@ -65,7 +66,7 @@ export function AdminResourceForm() {
|
||||
setTitle(r.title || "");
|
||||
setDescription(r.description || "");
|
||||
setRtype(r.type || "image");
|
||||
setLanguage(r.language || "zh-TW");
|
||||
setLanguage(r.language || "zh");
|
||||
setCategoryId(r.categoryId || 1);
|
||||
setCoverImage(r.coverImage || "");
|
||||
setFileUrl(r.fileUrl || "");
|
||||
@@ -182,9 +183,13 @@ export function AdminResourceForm() {
|
||||
value={language}
|
||||
onChange={(e) => setLanguage(e.target.value)}
|
||||
>
|
||||
<option value="zh-TW">{t("lang_zh_TW")}</option>
|
||||
<option value="zh-CN">{t("lang_zh_CN")}</option>
|
||||
<option value="zh">{t("lang_zh")}</option>
|
||||
<option value="en">{t("lang_en")}</option>
|
||||
<option value="ja">{t("lang_ja")}</option>
|
||||
<option value="ko">{t("lang_ko")}</option>
|
||||
<option value="vi">{t("lang_vi")}</option>
|
||||
<option value="id">{t("lang_id")}</option>
|
||||
<option value="ms">{t("lang_ms")}</option>
|
||||
</select>
|
||||
</Field>
|
||||
<Field label={t("status")}>
|
||||
|
||||
Reference in New Issue
Block a user