fix:detail article
This commit is contained in:
parent
2889a9acc2
commit
6202af2149
|
|
@ -231,8 +231,9 @@ export default function EditArticleForm(props: { isDetail: boolean }) {
|
||||||
setThumbnail(data?.thumbnailUrl);
|
setThumbnail(data?.thumbnailUrl);
|
||||||
setDiseId(data?.aiArticleId);
|
setDiseId(data?.aiArticleId);
|
||||||
setDetailFiles(data?.files);
|
setDetailFiles(data?.files);
|
||||||
|
|
||||||
if (
|
if (
|
||||||
data?.files &&
|
data?.files.length > 0 &&
|
||||||
(data.files[0].file_name.split(".")[1].includes("doc") ||
|
(data.files[0].file_name.split(".")[1].includes("doc") ||
|
||||||
data.files[0].file_name.split(".")[1].includes("pdf"))
|
data.files[0].file_name.split(".")[1].includes("pdf"))
|
||||||
) {
|
) {
|
||||||
|
|
@ -240,12 +241,14 @@ export default function EditArticleForm(props: { isDetail: boolean }) {
|
||||||
} else {
|
} else {
|
||||||
setSelectedFileType("image");
|
setSelectedFileType("image");
|
||||||
}
|
}
|
||||||
|
|
||||||
setupInitCategory(data?.categories);
|
setupInitCategory(data?.categories);
|
||||||
close();
|
close();
|
||||||
}
|
}
|
||||||
|
|
||||||
const setupInitCategory = (data: any) => {
|
const setupInitCategory = (data: any) => {
|
||||||
const temp: CategoryType[] = [];
|
const temp: CategoryType[] = [];
|
||||||
|
console.log("datass");
|
||||||
for (let i = 0; i < data?.length; i++) {
|
for (let i = 0; i < data?.length; i++) {
|
||||||
const datas = listCategory.filter((a) => a.id == data[i].id);
|
const datas = listCategory.filter((a) => a.id == data[i].id);
|
||||||
if (datas[0]) {
|
if (datas[0]) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue