fix: api in category approver
This commit is contained in:
parent
d7e4200f3c
commit
fd6ffda5a3
|
|
@ -26,6 +26,7 @@ import {
|
||||||
createMedia,
|
createMedia,
|
||||||
getTagsBySubCategoryId,
|
getTagsBySubCategoryId,
|
||||||
listEnableCategory,
|
listEnableCategory,
|
||||||
|
listEnableCategoryNew,
|
||||||
rejectFiles,
|
rejectFiles,
|
||||||
submitApproval,
|
submitApproval,
|
||||||
} from "@/service/content/content";
|
} from "@/service/content/content";
|
||||||
|
|
@ -485,7 +486,7 @@ export default function FormAudioDetail() {
|
||||||
|
|
||||||
const getCategories = async () => {
|
const getCategories = async () => {
|
||||||
try {
|
try {
|
||||||
const category = await listEnableCategory(fileTypeId);
|
const category = await listEnableCategoryNew(fileTypeId);
|
||||||
const resCategory: Category[] = category?.data.data.content;
|
const resCategory: Category[] = category?.data.data.content;
|
||||||
|
|
||||||
setCategories(resCategory);
|
setCategories(resCategory);
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,7 @@ import {
|
||||||
createMedia,
|
createMedia,
|
||||||
getTagsBySubCategoryId,
|
getTagsBySubCategoryId,
|
||||||
listEnableCategory,
|
listEnableCategory,
|
||||||
|
listEnableCategoryNew,
|
||||||
uploadThumbnail,
|
uploadThumbnail,
|
||||||
} from "@/service/content/content";
|
} from "@/service/content/content";
|
||||||
import { uploadThumbnailBlog } from "@/service/blog/blog";
|
import { uploadThumbnailBlog } from "@/service/blog/blog";
|
||||||
|
|
@ -465,7 +466,7 @@ export default function FormAudio() {
|
||||||
|
|
||||||
const getCategories = async () => {
|
const getCategories = async () => {
|
||||||
try {
|
try {
|
||||||
const category = await listEnableCategory(fileTypeId);
|
const category = await listEnableCategoryNew(fileTypeId);
|
||||||
const resCategory: Category[] = category?.data?.data?.content;
|
const resCategory: Category[] = category?.data?.data?.content;
|
||||||
|
|
||||||
setCategories(resCategory);
|
setCategories(resCategory);
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,7 @@ import {
|
||||||
deleteFile,
|
deleteFile,
|
||||||
getTagsBySubCategoryId,
|
getTagsBySubCategoryId,
|
||||||
listEnableCategory,
|
listEnableCategory,
|
||||||
|
listEnableCategoryNew,
|
||||||
updateFilePlacements,
|
updateFilePlacements,
|
||||||
uploadThumbnail,
|
uploadThumbnail,
|
||||||
} from "@/service/content/content";
|
} from "@/service/content/content";
|
||||||
|
|
@ -304,7 +305,7 @@ export default function FormAudioUpdate() {
|
||||||
|
|
||||||
const getCategories = async () => {
|
const getCategories = async () => {
|
||||||
try {
|
try {
|
||||||
const category = await listEnableCategory(fileTypeId);
|
const category = await listEnableCategoryNew(fileTypeId);
|
||||||
const resCategory: Category[] = category?.data.data.content;
|
const resCategory: Category[] = category?.data.data.content;
|
||||||
|
|
||||||
setCategories(resCategory);
|
setCategories(resCategory);
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,7 @@ import {
|
||||||
createMedia,
|
createMedia,
|
||||||
getTagsBySubCategoryId,
|
getTagsBySubCategoryId,
|
||||||
listEnableCategory,
|
listEnableCategory,
|
||||||
|
listEnableCategoryNew,
|
||||||
publishMedia,
|
publishMedia,
|
||||||
rejectFiles,
|
rejectFiles,
|
||||||
submitApproval,
|
submitApproval,
|
||||||
|
|
@ -878,7 +879,7 @@ export default function FormImageDetail() {
|
||||||
|
|
||||||
const getCategories = async () => {
|
const getCategories = async () => {
|
||||||
try {
|
try {
|
||||||
const category = await listEnableCategory(fileTypeId);
|
const category = await listEnableCategoryNew(fileTypeId);
|
||||||
const resCategory: Category[] = category?.data?.data?.content;
|
const resCategory: Category[] = category?.data?.data?.content;
|
||||||
|
|
||||||
setCategories(resCategory);
|
setCategories(resCategory);
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,7 @@ import {
|
||||||
createMedia,
|
createMedia,
|
||||||
getTagsBySubCategoryId,
|
getTagsBySubCategoryId,
|
||||||
listEnableCategory,
|
listEnableCategory,
|
||||||
|
listEnableCategoryNew,
|
||||||
uploadThumbnail,
|
uploadThumbnail,
|
||||||
} from "@/service/content/content";
|
} from "@/service/content/content";
|
||||||
import { uploadThumbnailBlog } from "@/service/blog/blog";
|
import { uploadThumbnailBlog } from "@/service/blog/blog";
|
||||||
|
|
@ -498,7 +499,7 @@ export default function FormImage() {
|
||||||
|
|
||||||
const getCategories = async () => {
|
const getCategories = async () => {
|
||||||
try {
|
try {
|
||||||
const category = await listEnableCategory(fileTypeId);
|
const category = await listEnableCategoryNew(fileTypeId);
|
||||||
const resCategory: Category[] = category?.data.data.content;
|
const resCategory: Category[] = category?.data.data.content;
|
||||||
|
|
||||||
setCategories(resCategory);
|
setCategories(resCategory);
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,7 @@ import {
|
||||||
deleteMedia,
|
deleteMedia,
|
||||||
getTagsBySubCategoryId,
|
getTagsBySubCategoryId,
|
||||||
listEnableCategory,
|
listEnableCategory,
|
||||||
|
listEnableCategoryNew,
|
||||||
updateFilePlacements,
|
updateFilePlacements,
|
||||||
uploadThumbnail,
|
uploadThumbnail,
|
||||||
} from "@/service/content/content";
|
} from "@/service/content/content";
|
||||||
|
|
@ -765,7 +766,7 @@ export default function FormImageUpdate() {
|
||||||
|
|
||||||
const getCategories = async () => {
|
const getCategories = async () => {
|
||||||
try {
|
try {
|
||||||
const category = await listEnableCategory(fileTypeId);
|
const category = await listEnableCategoryNew(fileTypeId);
|
||||||
const resCategory: Category[] = category?.data?.data?.content;
|
const resCategory: Category[] = category?.data?.data?.content;
|
||||||
|
|
||||||
setCategories(resCategory);
|
setCategories(resCategory);
|
||||||
|
|
|
||||||
|
|
@ -54,6 +54,7 @@ import {
|
||||||
detailSPIT,
|
detailSPIT,
|
||||||
getTagsBySubCategoryId,
|
getTagsBySubCategoryId,
|
||||||
listEnableCategory,
|
listEnableCategory,
|
||||||
|
listEnableCategoryNew,
|
||||||
} from "@/service/content/content";
|
} from "@/service/content/content";
|
||||||
import { generateDataRewrite, getDetailArticle } from "@/service/content/ai";
|
import { generateDataRewrite, getDetailArticle } from "@/service/content/ai";
|
||||||
import { getCookiesDecrypt } from "@/lib/utils";
|
import { getCookiesDecrypt } from "@/lib/utils";
|
||||||
|
|
@ -253,7 +254,7 @@ export default function FormConvertSPIT() {
|
||||||
|
|
||||||
const loadCategories = async () => {
|
const loadCategories = async () => {
|
||||||
try {
|
try {
|
||||||
const response = await listEnableCategory("1", true);
|
const response = await listEnableCategoryNew("1", true);
|
||||||
const categories = response?.data?.data?.content || [];
|
const categories = response?.data?.data?.content || [];
|
||||||
setCategories(categories);
|
setCategories(categories);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,7 @@ import {
|
||||||
createMedia,
|
createMedia,
|
||||||
getTagsBySubCategoryId,
|
getTagsBySubCategoryId,
|
||||||
listEnableCategory,
|
listEnableCategory,
|
||||||
|
listEnableCategoryNew,
|
||||||
rejectFiles,
|
rejectFiles,
|
||||||
submitApproval,
|
submitApproval,
|
||||||
} from "@/service/content/content";
|
} from "@/service/content/content";
|
||||||
|
|
@ -449,7 +450,7 @@ export default function FormTeksDetail() {
|
||||||
|
|
||||||
const getCategories = async () => {
|
const getCategories = async () => {
|
||||||
try {
|
try {
|
||||||
const category = await listEnableCategory(fileTypeId);
|
const category = await listEnableCategoryNew(fileTypeId);
|
||||||
const resCategory: Category[] = category?.data?.data?.content;
|
const resCategory: Category[] = category?.data?.data?.content;
|
||||||
|
|
||||||
setCategories(resCategory);
|
setCategories(resCategory);
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,7 @@ import {
|
||||||
createMedia,
|
createMedia,
|
||||||
getTagsBySubCategoryId,
|
getTagsBySubCategoryId,
|
||||||
listEnableCategory,
|
listEnableCategory,
|
||||||
|
listEnableCategoryNew,
|
||||||
uploadThumbnail,
|
uploadThumbnail,
|
||||||
} from "@/service/content/content";
|
} from "@/service/content/content";
|
||||||
import { uploadThumbnailBlog } from "@/service/blog/blog";
|
import { uploadThumbnailBlog } from "@/service/blog/blog";
|
||||||
|
|
@ -481,7 +482,7 @@ export default function FormTeks() {
|
||||||
|
|
||||||
const getCategories = async () => {
|
const getCategories = async () => {
|
||||||
try {
|
try {
|
||||||
const category = await listEnableCategory(fileTypeId);
|
const category = await listEnableCategoryNew(fileTypeId);
|
||||||
const resCategory: Category[] = category?.data?.data?.content;
|
const resCategory: Category[] = category?.data?.data?.content;
|
||||||
|
|
||||||
setCategories(resCategory);
|
setCategories(resCategory);
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,7 @@ import {
|
||||||
listEnableCategory,
|
listEnableCategory,
|
||||||
uploadThumbnail,
|
uploadThumbnail,
|
||||||
updateFilePlacements,
|
updateFilePlacements,
|
||||||
|
listEnableCategoryNew,
|
||||||
} from "@/service/content/content";
|
} from "@/service/content/content";
|
||||||
import { getUserLevelForAssignments } from "@/service/task";
|
import { getUserLevelForAssignments } from "@/service/task";
|
||||||
import { detailMedia } from "@/service/curated-content/curated-content";
|
import { detailMedia } from "@/service/curated-content/curated-content";
|
||||||
|
|
@ -326,7 +327,7 @@ export default function FormTeksUpdate() {
|
||||||
|
|
||||||
const getCategories = async () => {
|
const getCategories = async () => {
|
||||||
try {
|
try {
|
||||||
const category = await listEnableCategory(fileTypeId);
|
const category = await listEnableCategoryNew(fileTypeId);
|
||||||
const resCategory: Category[] = category?.data?.data?.content;
|
const resCategory: Category[] = category?.data?.data?.content;
|
||||||
|
|
||||||
setCategories(resCategory);
|
setCategories(resCategory);
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,7 @@ import {
|
||||||
createMedia,
|
createMedia,
|
||||||
getTagsBySubCategoryId,
|
getTagsBySubCategoryId,
|
||||||
listEnableCategory,
|
listEnableCategory,
|
||||||
|
listEnableCategoryNew,
|
||||||
rejectFiles,
|
rejectFiles,
|
||||||
submitApproval,
|
submitApproval,
|
||||||
} from "@/service/content/content";
|
} from "@/service/content/content";
|
||||||
|
|
@ -448,7 +449,7 @@ export default function FormVideoDetail() {
|
||||||
|
|
||||||
const getCategories = async () => {
|
const getCategories = async () => {
|
||||||
try {
|
try {
|
||||||
const category = await listEnableCategory(fileTypeId);
|
const category = await listEnableCategoryNew(fileTypeId);
|
||||||
const resCategory: Category[] = category?.data?.data?.content;
|
const resCategory: Category[] = category?.data?.data?.content;
|
||||||
|
|
||||||
setCategories(resCategory);
|
setCategories(resCategory);
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,7 @@ import {
|
||||||
createMedia,
|
createMedia,
|
||||||
getTagsBySubCategoryId,
|
getTagsBySubCategoryId,
|
||||||
listEnableCategory,
|
listEnableCategory,
|
||||||
|
listEnableCategoryNew,
|
||||||
uploadThumbnail,
|
uploadThumbnail,
|
||||||
} from "@/service/content/content";
|
} from "@/service/content/content";
|
||||||
import { Textarea } from "@/components/ui/textarea";
|
import { Textarea } from "@/components/ui/textarea";
|
||||||
|
|
@ -470,7 +471,7 @@ export default function FormVideo() {
|
||||||
|
|
||||||
const getCategories = async () => {
|
const getCategories = async () => {
|
||||||
try {
|
try {
|
||||||
const category = await listEnableCategory(fileTypeId);
|
const category = await listEnableCategoryNew(fileTypeId);
|
||||||
const resCategory: Category[] = category?.data?.data?.content;
|
const resCategory: Category[] = category?.data?.data?.content;
|
||||||
|
|
||||||
setCategories(resCategory);
|
setCategories(resCategory);
|
||||||
|
|
|
||||||
|
|
@ -44,6 +44,7 @@ import {
|
||||||
listEnableCategory,
|
listEnableCategory,
|
||||||
uploadThumbnail,
|
uploadThumbnail,
|
||||||
updateFilePlacements,
|
updateFilePlacements,
|
||||||
|
listEnableCategoryNew,
|
||||||
} from "@/service/content/content";
|
} from "@/service/content/content";
|
||||||
import { getUserLevelForAssignments } from "@/service/task";
|
import { getUserLevelForAssignments } from "@/service/task";
|
||||||
import { detailMedia } from "@/service/curated-content/curated-content";
|
import { detailMedia } from "@/service/curated-content/curated-content";
|
||||||
|
|
@ -339,7 +340,7 @@ export default function FormVideoUpdate() {
|
||||||
|
|
||||||
const getCategories = async () => {
|
const getCategories = async () => {
|
||||||
try {
|
try {
|
||||||
const category = await listEnableCategory(fileTypeId);
|
const category = await listEnableCategoryNew(fileTypeId);
|
||||||
const resCategory: Category[] = category?.data?.data?.content;
|
const resCategory: Category[] = category?.data?.data?.content;
|
||||||
|
|
||||||
setCategories(resCategory);
|
setCategories(resCategory);
|
||||||
|
|
|
||||||
|
|
@ -157,7 +157,11 @@ export async function getTagsBySubCategoryId(subCategory: any) {
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function listEnableCategory(type: any, status?: boolean) {
|
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);
|
return httpGetInterceptor(url);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue