diff --git a/components/form/content/audio-detail-form.tsx b/components/form/content/audio-detail-form.tsx index 37e56410..857f6215 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"; @@ -487,7 +488,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 122467fb..d93271c4 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 7fd45328..dd237345 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"; @@ -305,7 +306,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 07f7555d..be534e8a 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, @@ -879,7 +880,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 b125cf7d..f3f88619 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 522804a9..2a27e5bf 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"; @@ -766,7 +767,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 33ca0979..b975badb 100644 --- a/components/form/content/teks-detail-form.tsx +++ b/components/form/content/teks-detail-form.tsx @@ -23,6 +23,7 @@ import { createMedia, getTagsBySubCategoryId, listEnableCategory, + listEnableCategoryNew, rejectFiles, submitApproval, } from "@/service/content/content"; @@ -447,7 +448,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 3429c5a2..914e5bc6 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 57757eda..4f871c75 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"; @@ -327,7 +328,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 3c3804a2..2a2cd0b2 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"; @@ -450,7 +451,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 1edeeb0e..ee67cf4a 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 961fdb24..ddf18938 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"; @@ -340,7 +341,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); }