fix: api in category approver

This commit is contained in:
Sabda Yagra 2025-10-16 12:22:48 +07:00
parent d7e4200f3c
commit fd6ffda5a3
14 changed files with 31 additions and 14 deletions

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);
}