fix drone
continuous-integration/drone/push Build is failing
Details
continuous-integration/drone/push Build is failing
Details
This commit is contained in:
parent
c5b3e7cb3b
commit
206be7cf12
|
|
@ -65,13 +65,13 @@ const ViewEditor = dynamic(
|
||||||
() => {
|
() => {
|
||||||
return import("@/components/editor/view-editor");
|
return import("@/components/editor/view-editor");
|
||||||
},
|
},
|
||||||
{ ssr: false }
|
{ ssr: false },
|
||||||
);
|
);
|
||||||
const CustomEditor = dynamic(
|
const CustomEditor = dynamic(
|
||||||
() => {
|
() => {
|
||||||
return import("@/components/editor/custom-editor");
|
return import("@/components/editor/custom-editor");
|
||||||
},
|
},
|
||||||
{ ssr: false }
|
{ ssr: false },
|
||||||
);
|
);
|
||||||
|
|
||||||
interface FileWithPreview extends File {
|
interface FileWithPreview extends File {
|
||||||
|
|
@ -142,7 +142,7 @@ export default function EditArticleForm(props: { isDetail: boolean }) {
|
||||||
const [diseId, setDiseId] = useState(0);
|
const [diseId, setDiseId] = useState(0);
|
||||||
const [thumbnailImg, setThumbnailImg] = useState<File[]>([]);
|
const [thumbnailImg, setThumbnailImg] = useState<File[]>([]);
|
||||||
const [selectedMainImage, setSelectedMainImage] = useState<number | null>(
|
const [selectedMainImage, setSelectedMainImage] = useState<number | null>(
|
||||||
null
|
null,
|
||||||
);
|
);
|
||||||
const [thumbnailValidation, setThumbnailValidation] = useState("");
|
const [thumbnailValidation, setThumbnailValidation] = useState("");
|
||||||
// const { isOpen, onOpen, onOpenChange } = useDisclosure();
|
// const { isOpen, onOpen, onOpenChange } = useDisclosure();
|
||||||
|
|
@ -155,7 +155,7 @@ export default function EditArticleForm(props: { isDetail: boolean }) {
|
||||||
// const [startDateValue, setStartDateValue] = useState<any>(null);
|
// const [startDateValue, setStartDateValue] = useState<any>(null);
|
||||||
// const [timeValue, setTimeValue] = useState("00:00");
|
// const [timeValue, setTimeValue] = useState("00:00");
|
||||||
const [status, setStatus] = useState<"publish" | "draft" | "scheduled">(
|
const [status, setStatus] = useState<"publish" | "draft" | "scheduled">(
|
||||||
"publish"
|
"publish",
|
||||||
);
|
);
|
||||||
const [isScheduled, setIsScheduled] = useState(false);
|
const [isScheduled, setIsScheduled] = useState(false);
|
||||||
const [startDateValue, setStartDateValue] = useState<Date | undefined>();
|
const [startDateValue, setStartDateValue] = useState<Date | undefined>();
|
||||||
|
|
@ -225,13 +225,11 @@ export default function EditArticleForm(props: { isDetail: boolean }) {
|
||||||
setDiseId(articleData.aiArticleId);
|
setDiseId(articleData.aiArticleId);
|
||||||
setupInitCategory(articleData.categories);
|
setupInitCategory(articleData.categories);
|
||||||
|
|
||||||
// 2️⃣ Ambil SEMUA article files
|
|
||||||
const filesRes = await getArticleFiles();
|
const filesRes = await getArticleFiles();
|
||||||
const allFiles = filesRes.data?.data ?? [];
|
const allFiles = filesRes.data?.data ?? [];
|
||||||
|
|
||||||
// 3️⃣ FILTER berdasarkan ARTICLE ID yang sedang dibuka
|
|
||||||
const filteredFiles = allFiles.filter(
|
const filteredFiles = allFiles.filter(
|
||||||
(file: any) => file.articleId === articleData.id
|
(file: any) => file.articleId === articleData.id,
|
||||||
);
|
);
|
||||||
|
|
||||||
setDetailFiles(filteredFiles);
|
setDetailFiles(filteredFiles);
|
||||||
|
|
@ -352,12 +350,12 @@ export default function EditArticleForm(props: { isDetail: boolean }) {
|
||||||
combinedDate.setHours(hours, minutes, 0, 0);
|
combinedDate.setHours(hours, minutes, 0, 0);
|
||||||
|
|
||||||
const formattedDateTime = `${combinedDate.getFullYear()}-${String(
|
const formattedDateTime = `${combinedDate.getFullYear()}-${String(
|
||||||
combinedDate.getMonth() + 1
|
combinedDate.getMonth() + 1,
|
||||||
).padStart(2, "0")}-${String(combinedDate.getDate()).padStart(
|
).padStart(2, "0")}-${String(combinedDate.getDate()).padStart(
|
||||||
2,
|
2,
|
||||||
"0"
|
"0",
|
||||||
)} ${String(combinedDate.getHours()).padStart(2, "0")}:${String(
|
)} ${String(combinedDate.getHours()).padStart(2, "0")}:${String(
|
||||||
combinedDate.getMinutes()
|
combinedDate.getMinutes(),
|
||||||
).padStart(2, "0")}:00`;
|
).padStart(2, "0")}:00`;
|
||||||
|
|
||||||
const response = await updateArticle(String(id), {
|
const response = await updateArticle(String(id), {
|
||||||
|
|
@ -448,12 +446,12 @@ export default function EditArticleForm(props: { isDetail: boolean }) {
|
||||||
|
|
||||||
// format: 2025-10-08 14:30:00
|
// format: 2025-10-08 14:30:00
|
||||||
const formattedDateTime = `${combinedDate.getFullYear()}-${String(
|
const formattedDateTime = `${combinedDate.getFullYear()}-${String(
|
||||||
combinedDate.getMonth() + 1
|
combinedDate.getMonth() + 1,
|
||||||
).padStart(2, "0")}-${String(combinedDate.getDate()).padStart(
|
).padStart(2, "0")}-${String(combinedDate.getDate()).padStart(
|
||||||
2,
|
2,
|
||||||
"0"
|
"0",
|
||||||
)} ${String(combinedDate.getHours()).padStart(2, "0")}:${String(
|
)} ${String(combinedDate.getHours()).padStart(2, "0")}:${String(
|
||||||
combinedDate.getMinutes()
|
combinedDate.getMinutes(),
|
||||||
).padStart(2, "0")}:00`;
|
).padStart(2, "0")}:00`;
|
||||||
|
|
||||||
const request = {
|
const request = {
|
||||||
|
|
@ -1070,7 +1068,7 @@ export default function EditArticleForm(props: { isDetail: boolean }) {
|
||||||
className="w-3 h-3 cursor-pointer"
|
className="w-3 h-3 cursor-pointer"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
const filteredTags = value.filter(
|
const filteredTags = value.filter(
|
||||||
(tag: string) => tag !== item
|
(tag: string) => tag !== item,
|
||||||
);
|
);
|
||||||
if (filteredTags.length === 0) {
|
if (filteredTags.length === 0) {
|
||||||
setError("tags", {
|
setError("tags", {
|
||||||
|
|
@ -1081,7 +1079,7 @@ export default function EditArticleForm(props: { isDetail: boolean }) {
|
||||||
clearErrors("tags");
|
clearErrors("tags");
|
||||||
setValue(
|
setValue(
|
||||||
"tags",
|
"tags",
|
||||||
filteredTags as [string, ...string[]]
|
filteredTags as [string, ...string[]],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue