diff --git a/components/form/content/audio-detail-form.tsx b/components/form/content/audio-detail-form.tsx index 916e9d09..a081a0f9 100644 --- a/components/form/content/audio-detail-form.tsx +++ b/components/form/content/audio-detail-form.tsx @@ -26,6 +26,7 @@ import { createMedia, getTagsBySubCategoryId, listEnableCategory, + listEnableCategoryNew, rejectFiles, submitApproval, } from "@/service/content/content"; @@ -485,7 +486,7 @@ export default function FormAudioDetail() { const getCategories = async () => { try { - const category = await listEnableCategory(fileTypeId); + const category = await listEnableCategoryNew(fileTypeId); const resCategory: Category[] = category?.data.data.content; setCategories(resCategory); diff --git a/components/form/content/audio-form.tsx b/components/form/content/audio-form.tsx index 9b3849fc..e730e553 100644 --- a/components/form/content/audio-form.tsx +++ b/components/form/content/audio-form.tsx @@ -34,6 +34,7 @@ import { createMedia, getTagsBySubCategoryId, listEnableCategory, + listEnableCategoryNew, uploadThumbnail, } from "@/service/content/content"; import { uploadThumbnailBlog } from "@/service/blog/blog"; @@ -465,7 +466,7 @@ export default function FormAudio() { const getCategories = async () => { try { - const category = await listEnableCategory(fileTypeId); + const category = await listEnableCategoryNew(fileTypeId); const resCategory: Category[] = category?.data?.data?.content; setCategories(resCategory); diff --git a/components/form/content/audio-update-form.tsx b/components/form/content/audio-update-form.tsx index ffd5b59b..d782be82 100644 --- a/components/form/content/audio-update-form.tsx +++ b/components/form/content/audio-update-form.tsx @@ -30,6 +30,7 @@ import { deleteFile, getTagsBySubCategoryId, listEnableCategory, + listEnableCategoryNew, updateFilePlacements, uploadThumbnail, } from "@/service/content/content"; @@ -304,7 +305,7 @@ export default function FormAudioUpdate() { const getCategories = async () => { try { - const category = await listEnableCategory(fileTypeId); + const category = await listEnableCategoryNew(fileTypeId); const resCategory: Category[] = category?.data.data.content; setCategories(resCategory); diff --git a/components/form/content/image-detail-form.tsx b/components/form/content/image-detail-form.tsx index 95f9c8cd..ecb3f576 100644 --- a/components/form/content/image-detail-form.tsx +++ b/components/form/content/image-detail-form.tsx @@ -26,6 +26,7 @@ import { createMedia, getTagsBySubCategoryId, listEnableCategory, + listEnableCategoryNew, publishMedia, rejectFiles, submitApproval, @@ -878,7 +879,7 @@ export default function FormImageDetail() { const getCategories = async () => { try { - const category = await listEnableCategory(fileTypeId); + const category = await listEnableCategoryNew(fileTypeId); const resCategory: Category[] = category?.data?.data?.content; setCategories(resCategory); diff --git a/components/form/content/image-form.tsx b/components/form/content/image-form.tsx index b8a649b2..be778609 100644 --- a/components/form/content/image-form.tsx +++ b/components/form/content/image-form.tsx @@ -34,6 +34,7 @@ import { createMedia, getTagsBySubCategoryId, listEnableCategory, + listEnableCategoryNew, uploadThumbnail, } from "@/service/content/content"; import { uploadThumbnailBlog } from "@/service/blog/blog"; @@ -498,7 +499,7 @@ export default function FormImage() { const getCategories = async () => { try { - const category = await listEnableCategory(fileTypeId); + const category = await listEnableCategoryNew(fileTypeId); const resCategory: Category[] = category?.data.data.content; setCategories(resCategory); diff --git a/components/form/content/image-update-form.tsx b/components/form/content/image-update-form.tsx index 8a52bcd3..300b0223 100644 --- a/components/form/content/image-update-form.tsx +++ b/components/form/content/image-update-form.tsx @@ -32,6 +32,7 @@ import { deleteMedia, getTagsBySubCategoryId, listEnableCategory, + listEnableCategoryNew, updateFilePlacements, uploadThumbnail, } from "@/service/content/content"; @@ -765,7 +766,7 @@ export default function FormImageUpdate() { const getCategories = async () => { try { - const category = await listEnableCategory(fileTypeId); + const category = await listEnableCategoryNew(fileTypeId); const resCategory: Category[] = category?.data?.data?.content; setCategories(resCategory); diff --git a/components/form/content/spit-convert-form.tsx b/components/form/content/spit-convert-form.tsx index b14a392e..081aaf2f 100644 --- a/components/form/content/spit-convert-form.tsx +++ b/components/form/content/spit-convert-form.tsx @@ -54,6 +54,7 @@ import { detailSPIT, getTagsBySubCategoryId, listEnableCategory, + listEnableCategoryNew, } from "@/service/content/content"; import { generateDataRewrite, getDetailArticle } from "@/service/content/ai"; import { getCookiesDecrypt } from "@/lib/utils"; @@ -253,7 +254,7 @@ export default function FormConvertSPIT() { const loadCategories = async () => { try { - const response = await listEnableCategory("1", true); + const response = await listEnableCategoryNew("1", true); const categories = response?.data?.data?.content || []; setCategories(categories); diff --git a/components/form/content/teks-detail-form.tsx b/components/form/content/teks-detail-form.tsx index 807029d7..f7ce197a 100644 --- a/components/form/content/teks-detail-form.tsx +++ b/components/form/content/teks-detail-form.tsx @@ -27,6 +27,7 @@ import { createMedia, getTagsBySubCategoryId, listEnableCategory, + listEnableCategoryNew, rejectFiles, submitApproval, } from "@/service/content/content"; @@ -449,7 +450,7 @@ export default function FormTeksDetail() { const getCategories = async () => { try { - const category = await listEnableCategory(fileTypeId); + const category = await listEnableCategoryNew(fileTypeId); const resCategory: Category[] = category?.data?.data?.content; setCategories(resCategory); diff --git a/components/form/content/teks-form.tsx b/components/form/content/teks-form.tsx index 8b21e03d..e0d23d65 100644 --- a/components/form/content/teks-form.tsx +++ b/components/form/content/teks-form.tsx @@ -32,6 +32,7 @@ import { createMedia, getTagsBySubCategoryId, listEnableCategory, + listEnableCategoryNew, uploadThumbnail, } from "@/service/content/content"; import { uploadThumbnailBlog } from "@/service/blog/blog"; @@ -481,7 +482,7 @@ export default function FormTeks() { const getCategories = async () => { try { - const category = await listEnableCategory(fileTypeId); + const category = await listEnableCategoryNew(fileTypeId); const resCategory: Category[] = category?.data?.data?.content; setCategories(resCategory); diff --git a/components/form/content/teks-update-form.tsx b/components/form/content/teks-update-form.tsx index b28164d0..d161a36a 100644 --- a/components/form/content/teks-update-form.tsx +++ b/components/form/content/teks-update-form.tsx @@ -35,6 +35,7 @@ import { listEnableCategory, uploadThumbnail, updateFilePlacements, + listEnableCategoryNew, } from "@/service/content/content"; import { getUserLevelForAssignments } from "@/service/task"; import { detailMedia } from "@/service/curated-content/curated-content"; @@ -326,7 +327,7 @@ export default function FormTeksUpdate() { const getCategories = async () => { try { - const category = await listEnableCategory(fileTypeId); + const category = await listEnableCategoryNew(fileTypeId); const resCategory: Category[] = category?.data?.data?.content; setCategories(resCategory); diff --git a/components/form/content/video-detail-form.tsx b/components/form/content/video-detail-form.tsx index fd365ccf..a4a8699c 100644 --- a/components/form/content/video-detail-form.tsx +++ b/components/form/content/video-detail-form.tsx @@ -27,6 +27,7 @@ import { createMedia, getTagsBySubCategoryId, listEnableCategory, + listEnableCategoryNew, rejectFiles, submitApproval, } from "@/service/content/content"; @@ -448,7 +449,7 @@ export default function FormVideoDetail() { const getCategories = async () => { try { - const category = await listEnableCategory(fileTypeId); + const category = await listEnableCategoryNew(fileTypeId); const resCategory: Category[] = category?.data?.data?.content; setCategories(resCategory); diff --git a/components/form/content/video-form.tsx b/components/form/content/video-form.tsx index e50da4ba..b9f4972c 100644 --- a/components/form/content/video-form.tsx +++ b/components/form/content/video-form.tsx @@ -32,6 +32,7 @@ import { createMedia, getTagsBySubCategoryId, listEnableCategory, + listEnableCategoryNew, uploadThumbnail, } from "@/service/content/content"; import { Textarea } from "@/components/ui/textarea"; @@ -470,7 +471,7 @@ export default function FormVideo() { const getCategories = async () => { try { - const category = await listEnableCategory(fileTypeId); + const category = await listEnableCategoryNew(fileTypeId); const resCategory: Category[] = category?.data?.data?.content; setCategories(resCategory); diff --git a/components/form/content/video-update-form.tsx b/components/form/content/video-update-form.tsx index 0b8fa430..568c3bda 100644 --- a/components/form/content/video-update-form.tsx +++ b/components/form/content/video-update-form.tsx @@ -44,6 +44,7 @@ import { listEnableCategory, uploadThumbnail, updateFilePlacements, + listEnableCategoryNew, } from "@/service/content/content"; import { getUserLevelForAssignments } from "@/service/task"; import { detailMedia } from "@/service/curated-content/curated-content"; @@ -339,7 +340,7 @@ export default function FormVideoUpdate() { const getCategories = async () => { try { - const category = await listEnableCategory(fileTypeId); + const category = await listEnableCategoryNew(fileTypeId); const resCategory: Category[] = category?.data?.data?.content; setCategories(resCategory); diff --git a/service/content/content.ts b/service/content/content.ts index ee4891ab..144748b5 100644 --- a/service/content/content.ts +++ b/service/content/content.ts @@ -157,7 +157,11 @@ export async function getTagsBySubCategoryId(subCategory: any) { } export async function listEnableCategory(type: any, status?: boolean) { - const url = `media/categories/list/publish?enablePage=0&sort=desc&sortBy=id&type=${type}&isInt=true&isPublish=${status || ""}`; + const url = `media/categories/list?enablePage=0&sort=desc&sortBy=id&type=${type}&isInt=true&isPublish=${status || ""}`; + return httpGetInterceptor(url); +} +export async function listEnableCategoryNew(type: any, status?: boolean) { + const url = `media/categories/list/publish?enablePage=0&sort=desc&sortBy=id&type=${type}&isPublish=${status || ""}`; return httpGetInterceptor(url); }