diff --git a/app/[locale]/(protected)/blog/table-blog/blog-table.tsx b/app/[locale]/(protected)/blog/table-blog/blog-table.tsx index 210931e0..584351c5 100644 --- a/app/[locale]/(protected)/blog/table-blog/blog-table.tsx +++ b/app/[locale]/(protected)/blog/table-blog/blog-table.tsx @@ -56,7 +56,6 @@ export type CompanyData = { import { data } from "./data"; import { Input } from "@/components/ui/input"; import { InputGroup, InputGroupText } from "@/components/ui/input-group"; -import { listTask } from "@/service/ppid-categories-services"; import { paginationBlog } from "@/service/blog/blog"; export const columns: ColumnDef[] = [ diff --git a/app/[locale]/(protected)/communication/internal/table-internal/internal-table.tsx b/app/[locale]/(protected)/communication/internal/table-internal/internal-table.tsx index db7d14e3..977ed480 100644 --- a/app/[locale]/(protected)/communication/internal/table-internal/internal-table.tsx +++ b/app/[locale]/(protected)/communication/internal/table-internal/internal-table.tsx @@ -49,7 +49,7 @@ import { export type CompanyData = { no: number; title: string; - commentFromUserName: string; + createdBy: string; commentToUserName: string; createdAt: string; }; @@ -86,21 +86,17 @@ export const columns: ColumnDef[] = [ ), }, { - accessorKey: "commentFromUserName", + accessorKey: "createdBy", header: "Pengirim ", cell: ({ row }) => ( - - {row.getValue("commentFromUserName")} - + {row.getValue("createdBy")} ), }, { - accessorKey: "commentToUserName", + accessorKey: "sendTo", header: "Penerima", cell: ({ row }) => ( - - {row.getValue("commentToUserName")} - + {row.getValue("sendTo")} ), }, { @@ -158,7 +154,7 @@ const InternalTable = () => { const [rowSelection, setRowSelection] = React.useState({}); const [pagination, setPagination] = React.useState({ pageIndex: 0, - pageSize: 6, + pageSize: 10, }); const [page, setPage] = React.useState(1); const [totalPage, setTotalPage] = React.useState(1); @@ -191,9 +187,8 @@ const InternalTable = () => { async function initState() { try { - const res = await listTicketingInternal(page); - - const data = res.data.content.map((item: any, index: number) => ({ + const res = await listTicketingInternal(limit, page); + const data = res.data.data.content.map((item: any, index: number) => ({ no: (page - 1) * limit + index + 1, title: item.title, commentFromUserName: item.commentFromUserName, diff --git a/app/[locale]/(protected)/content/image/table-image/index.tsx b/app/[locale]/(protected)/content/image/table-image/index.tsx index 9c6f6261..72081800 100644 --- a/app/[locale]/(protected)/content/image/table-image/index.tsx +++ b/app/[locale]/(protected)/content/image/table-image/index.tsx @@ -210,7 +210,7 @@ const TableImage = () => { pageIndex: 0, // Halaman pertama pageSize: 10, // Jumlah baris per halaman }); - const [totalPage, setTotalPage] = React.useState(1); + const [totalPage, setTotalPage] = React.useState(10); const [limit, setLimit] = React.useState(10); // Jumlah baris per halaman const [search, setSearch] = React.useState(""); const userId = getCookiesDecrypt("uie"); diff --git a/app/[locale]/(protected)/planning/mediahub/table-mediahub/mediahub-table.tsx b/app/[locale]/(protected)/planning/mediahub/table-mediahub/mediahub-table.tsx index d1185740..0a6e21a0 100644 --- a/app/[locale]/(protected)/planning/mediahub/table-mediahub/mediahub-table.tsx +++ b/app/[locale]/(protected)/planning/mediahub/table-mediahub/mediahub-table.tsx @@ -54,8 +54,6 @@ export type CompanyData = { import { data } from "./data"; import { Input } from "@/components/ui/input"; import { InputGroup, InputGroupText } from "@/components/ui/input-group"; -import { listTask } from "@/service/ppid-categories-services"; -import page from "../page"; import { getPlanningSentPagination } from "@/service/planning/planning"; export const columns: ColumnDef[] = [ diff --git a/app/[locale]/(protected)/schedule/event/table-event/event-table.tsx b/app/[locale]/(protected)/schedule/event/table-event/event-table.tsx index 99d6069e..825121b3 100644 --- a/app/[locale]/(protected)/schedule/event/table-event/event-table.tsx +++ b/app/[locale]/(protected)/schedule/event/table-event/event-table.tsx @@ -46,11 +46,12 @@ import { } from "@/components/ui/dropdown-menu"; export type CompanyData = { + no: number; title: string; startDate: string; endDate: string; - time: string; - loccation: string; + startTime: string; + address: string; speakerName: string; uploaderName: string; status: string; @@ -58,8 +59,24 @@ export type CompanyData = { import { data } from "./data"; import { Input } from "@/components/ui/input"; import { InputGroup, InputGroupText } from "@/components/ui/input-group"; +import { paginationBlog } from "@/service/blog/blog"; +import { paginationSchedule } from "@/service/schedule/schedule"; export const columns: ColumnDef[] = [ + { + accessorKey: "no", + header: "No", + cell: ({ row }) => ( +
+
+

+ {row.getValue("no")} +

+
+
+ ), + }, + { accessorKey: "title", header: "Judul", @@ -88,19 +105,30 @@ export const columns: ColumnDef[] = [ ), }, { - accessorKey: "time", + accessorKey: "startTime", header: "Waktu", cell: ({ row }) => ( - {row.getValue("time")} + {row.getValue("startTime")} ), }, { - accessorKey: "loccation", + accessorKey: "address", header: "Lokasi", cell: ({ row }) => ( - {row.getValue("loccation")} + {row.getValue("address")} ), }, + { + accessorKey: "status", + header: "Status", + cell: ({ row }) => { + return ( + + {row.getValue("status")} + + ); + }, + }, { accessorKey: "speakerName", header: "Disampaikan oleh", @@ -115,17 +143,7 @@ export const columns: ColumnDef[] = [ {row.getValue("uploaderName")} ), }, - { - accessorKey: "status", - header: "Status", - cell: ({ row }) => { - return ( - - {row.getValue("status")} - - ); - }, - }, + { id: "actions", accessorKey: "action", @@ -164,6 +182,7 @@ export const columns: ColumnDef[] = [ ]; const EventTable = () => { + const [eventTable, setEventTable] = React.useState([]); const [sorting, setSorting] = React.useState([]); const [columnFilters, setColumnFilters] = React.useState( [] @@ -173,11 +192,14 @@ const EventTable = () => { const [rowSelection, setRowSelection] = React.useState({}); const [pagination, setPagination] = React.useState({ pageIndex: 0, - pageSize: 6, + pageSize: 10, }); + const [page, setPage] = React.useState(1); + const [totalPage, setTotalPage] = React.useState(1); + const [limit, setLimit] = React.useState(10); const table = useReactTable({ - data, + data: eventTable, columns, onSortingChange: setSorting, onColumnFiltersChange: setColumnFilters, @@ -197,6 +219,31 @@ const EventTable = () => { }, }); + React.useEffect(() => { + initState(); + }, [page, limit]); + + async function initState() { + try { + const res = await paginationSchedule(limit, page, 2); + const data = res.data.data.content.map((item: any, index: number) => ({ + no: (page - 1) * limit + index + 1, + title: item.title, + startDate: item.startDate, + endDate: item.endDate, + startTime: item.startTime, + address: item.address, + uploaderName: item.uploaderName, + speakerName: item.speakerName, + })); + + setEventTable(data); + setTotalPage(res.data.totalPages); + } catch (error) { + console.error("Error fetching tasks:", error); + } + } + return (
diff --git a/app/[locale]/(protected)/schedule/press-conference/table-presscon/presscon-table.tsx b/app/[locale]/(protected)/schedule/press-conference/table-presscon/presscon-table.tsx index 632dfb8a..b35e1840 100644 --- a/app/[locale]/(protected)/schedule/press-conference/table-presscon/presscon-table.tsx +++ b/app/[locale]/(protected)/schedule/press-conference/table-presscon/presscon-table.tsx @@ -46,11 +46,12 @@ import { } from "@/components/ui/dropdown-menu"; export type CompanyData = { + no: number; title: string; startDate: string; endDate: string; - time: string; - loccation: string; + startTime: string; + address: string; speakerName: string; uploaderName: string; status: string; @@ -58,8 +59,24 @@ export type CompanyData = { import { data } from "./data"; import { Input } from "@/components/ui/input"; import { InputGroup, InputGroupText } from "@/components/ui/input-group"; +import { paginationBlog } from "@/service/blog/blog"; +import { paginationSchedule } from "@/service/schedule/schedule"; export const columns: ColumnDef[] = [ + { + accessorKey: "no", + header: "No", + cell: ({ row }) => ( +
+
+

+ {row.getValue("no")} +

+
+
+ ), + }, + { accessorKey: "title", header: "Judul", @@ -88,19 +105,30 @@ export const columns: ColumnDef[] = [ ), }, { - accessorKey: "time", + accessorKey: "startTime", header: "Waktu", cell: ({ row }) => ( - {row.getValue("time")} + {row.getValue("startTime")} ), }, { - accessorKey: "loccation", + accessorKey: "address", header: "Lokasi", cell: ({ row }) => ( - {row.getValue("loccation")} + {row.getValue("address")} ), }, + { + accessorKey: "status", + header: "Status", + cell: ({ row }) => { + return ( + + {row.getValue("status")} + + ); + }, + }, { accessorKey: "speakerName", header: "Disampaikan oleh", @@ -115,17 +143,7 @@ export const columns: ColumnDef[] = [ {row.getValue("uploaderName")} ), }, - { - accessorKey: "status", - header: "Status", - cell: ({ row }) => { - return ( - - {row.getValue("status")} - - ); - }, - }, + { id: "actions", accessorKey: "action", @@ -163,7 +181,8 @@ export const columns: ColumnDef[] = [ }, ]; -const PressReleaseTable = () => { +const PressConTable = () => { + const [pressconTable, setPressConTable] = React.useState([]); const [sorting, setSorting] = React.useState([]); const [columnFilters, setColumnFilters] = React.useState( [] @@ -173,11 +192,14 @@ const PressReleaseTable = () => { const [rowSelection, setRowSelection] = React.useState({}); const [pagination, setPagination] = React.useState({ pageIndex: 0, - pageSize: 6, + pageSize: 10, }); + const [page, setPage] = React.useState(1); + const [totalPage, setTotalPage] = React.useState(1); + const [limit, setLimit] = React.useState(10); const table = useReactTable({ - data, + data: pressconTable, columns, onSortingChange: setSorting, onColumnFiltersChange: setColumnFilters, @@ -197,6 +219,31 @@ const PressReleaseTable = () => { }, }); + React.useEffect(() => { + initState(); + }, [page, limit]); + + async function initState() { + try { + const res = await paginationSchedule(limit, page, 1); + const data = res.data.data.content.map((item: any, index: number) => ({ + no: (page - 1) * limit + index + 1, + title: item.title, + startDate: item.startDate, + endDate: item.endDate, + startTime: item.startTime, + address: item.address, + uploaderName: item.uploaderName, + speakerName: item.speakerName, + })); + + setPressConTable(data); + setTotalPage(res.data.totalPages); + } catch (error) { + console.error("Error fetching tasks:", error); + } + } + return (
@@ -305,4 +352,4 @@ const PressReleaseTable = () => { ); }; -export default PressReleaseTable; +export default PressConTable; diff --git a/app/[locale]/(protected)/schedule/press-release/table-persrilis/pressrilis-table.tsx b/app/[locale]/(protected)/schedule/press-release/table-persrilis/pressrilis-table.tsx index 7225dace..e4a76bc3 100644 --- a/app/[locale]/(protected)/schedule/press-release/table-persrilis/pressrilis-table.tsx +++ b/app/[locale]/(protected)/schedule/press-release/table-persrilis/pressrilis-table.tsx @@ -46,11 +46,12 @@ import { } from "@/components/ui/dropdown-menu"; export type CompanyData = { + no: number; title: string; startDate: string; endDate: string; - time: string; - loccation: string; + startTime: string; + address: string; speakerName: string; uploaderName: string; status: string; @@ -58,8 +59,24 @@ export type CompanyData = { import { data } from "./data"; import { Input } from "@/components/ui/input"; import { InputGroup, InputGroupText } from "@/components/ui/input-group"; +import { paginationBlog } from "@/service/blog/blog"; +import { paginationSchedule } from "@/service/schedule/schedule"; export const columns: ColumnDef[] = [ + { + accessorKey: "no", + header: "No", + cell: ({ row }) => ( +
+
+

+ {row.getValue("no")} +

+
+
+ ), + }, + { accessorKey: "title", header: "Judul", @@ -88,19 +105,30 @@ export const columns: ColumnDef[] = [ ), }, { - accessorKey: "time", + accessorKey: "startTime", header: "Waktu", cell: ({ row }) => ( - {row.getValue("time")} + {row.getValue("startTime")} ), }, { - accessorKey: "loccation", + accessorKey: "address", header: "Lokasi", cell: ({ row }) => ( - {row.getValue("loccation")} + {row.getValue("address")} ), }, + { + accessorKey: "status", + header: "Status", + cell: ({ row }) => { + return ( + + {row.getValue("status")} + + ); + }, + }, { accessorKey: "speakerName", header: "Disampaikan oleh", @@ -115,17 +143,7 @@ export const columns: ColumnDef[] = [ {row.getValue("uploaderName")} ), }, - { - accessorKey: "status", - header: "Status", - cell: ({ row }) => { - return ( - - {row.getValue("status")} - - ); - }, - }, + { id: "actions", accessorKey: "action", @@ -163,7 +181,10 @@ export const columns: ColumnDef[] = [ }, ]; -const PressConferenceTable = () => { +const PressReleaseTable = () => { + const [pressReleaseTable, setPressReleaseTable] = React.useState< + CompanyData[] + >([]); const [sorting, setSorting] = React.useState([]); const [columnFilters, setColumnFilters] = React.useState( [] @@ -173,11 +194,14 @@ const PressConferenceTable = () => { const [rowSelection, setRowSelection] = React.useState({}); const [pagination, setPagination] = React.useState({ pageIndex: 0, - pageSize: 6, + pageSize: 10, }); + const [page, setPage] = React.useState(1); + const [totalPage, setTotalPage] = React.useState(1); + const [limit, setLimit] = React.useState(10); const table = useReactTable({ - data, + data: pressReleaseTable, columns, onSortingChange: setSorting, onColumnFiltersChange: setColumnFilters, @@ -197,6 +221,31 @@ const PressConferenceTable = () => { }, }); + React.useEffect(() => { + initState(); + }, [page, limit]); + + async function initState() { + try { + const res = await paginationSchedule(limit, page, 3); + const data = res.data.data.content.map((item: any, index: number) => ({ + no: (page - 1) * limit + index + 1, + title: item.title, + startDate: item.startDate, + endDate: item.endDate, + startTime: item.startTime, + address: item.address, + uploaderName: item.uploaderName, + speakerName: item.speakerName, + })); + + setPressReleaseTable(data); + setTotalPage(res.data.totalPages); + } catch (error) { + console.error("Error fetching tasks:", error); + } + } + return (
@@ -305,4 +354,4 @@ const PressConferenceTable = () => { ); }; -export default PressConferenceTable; +export default PressReleaseTable; diff --git a/components/form/content/create-form.tsx b/components/form/content/create-form.tsx index 3b695882..6a9540e9 100644 --- a/components/form/content/create-form.tsx +++ b/components/form/content/create-form.tsx @@ -1,5 +1,5 @@ "use client"; -import React, { ChangeEvent, useRef, useState } from "react"; +import React, { ChangeEvent, useEffect, useRef, useState } from "react"; import { useForm, Controller } from "react-hook-form"; import { Input } from "@/components/ui/input"; import { Button } from "@/components/ui/button"; @@ -22,36 +22,49 @@ import { RadioGroup, RadioGroupItem } from "@/components/ui/radio-group"; import JoditEditor from "jodit-react"; import { register } from "module"; import { Switch } from "@/components/ui/switch"; +import Cookies from "js-cookie"; +import { + getTagsBySubCategoryId, + listEnableCategory, +} from "@/service/content/content"; +import { data } from "jquery"; const taskSchema = z.object({ title: z.string().min(1, { message: "Judul diperlukan" }), - naration: z.string().min(2, { + description: z.string().min(2, { message: "Narasi Penugasan harus lebih dari 2 karakter.", }), + categoryId: z.string().min(1, { message: "Judul diperlukan" }), creator: z.string().min(1, { message: "Judul diperlukan" }), tags: z.string().min(1, { message: "Judul diperlukan" }), }); +type Category = { + id: string; + name: string; +}; + export default function FormImage() { const MySwal = withReactContent(Swal); const router = useRouter(); const editor = useRef(null); type TaskSchema = z.infer; - const [tags, setTags] = useState([]); - const [selectedFiles, setSelectedFiles] = useState([]); - // State for various form fields - const [output, setOutput] = useState({ - all: false, - video: false, - audio: false, - image: false, - text: false, - }); + const [selectedFiles, setSelectedFiles] = useState([]); + const taskId = Cookies.get("taskId"); const [assignmentType, setAssignmentType] = useState("mediahub"); const [assignmentCategory, setAssignmentCategory] = useState("publication"); + const scheduleId = Cookies.get("scheduleId"); + const scheduleType = Cookies.get("scheduleType"); + + const [categories, setCategories] = useState([]); + const [selectedCategory, setSelectedCategory] = useState< + string | undefined + >(); + const [tags, setTags] = useState([]); + const [selectedTarget, setSelectedTarget] = useState("all"); const [unitSelection, setUnitSelection] = useState({ allUnit: false, @@ -60,6 +73,8 @@ export default function FormImage() { polres: false, }); + let fileTypeId = ""; + const { control, handleSubmit, @@ -92,6 +107,45 @@ export default function FormImage() { } }; + useEffect(() => { + async function initState() { + getCategories(); + // setVideoActive(fileTypeId == '2'); + // getRoles(); + } + + initState(); + }, []); + + const getCategories = async () => { + try { + const category = await listEnableCategory(fileTypeId); + const resCategory: Category[] = category.data.data.content; + + setCategories(resCategory); + console.log("data category", resCategory); + + if (scheduleId && scheduleType === "3") { + const findCategory = resCategory.find((o) => + o.name.toLowerCase().includes("pers rilis") + ); + + if (findCategory) { + setValue("categoryId", findCategory.id); + setSelectedCategory(findCategory.id); // Set the selected category + const response = await getTagsBySubCategoryId(findCategory.id); + setTags(response?.data.data); + } + } + } catch (error) { + console.error("Failed to fetch categories:", error); + } + }; + + useEffect(() => { + getCategories(); + }, []); + const handleRemoveImage = (index: number) => { setSelectedFiles((prevImages) => prevImages.filter((_, i) => i !== index)); }; @@ -99,7 +153,6 @@ export default function FormImage() { const save = async (data: TaskSchema) => { const requestData = { ...data, - output, assignmentType, assignmentCategory, target: selectedTarget, @@ -164,26 +217,46 @@ export default function FormImage() {
- - + + ( + + )} + /> + {errors.categoryId?.message && ( +

+ {errors.categoryId.message} +

+ )}
( )} /> - {errors.naration?.message && ( + {errors.description?.message && (

- {errors.naration.message} + {errors.description.message}

)}
diff --git a/service/auth.ts b/service/auth.ts index aec9b966..56bb84c7 100644 --- a/service/auth.ts +++ b/service/auth.ts @@ -1,5 +1,3 @@ -import Cookies from "js-cookie"; - import { getAPI, postAPI, postAPIWithJson } from "../config/api"; import { getAPIDummy } from "./http-config/axiosCustom"; diff --git a/service/blog/blog.ts b/service/blog/blog.ts index 85f9bc16..207dc999 100644 --- a/service/blog/blog.ts +++ b/service/blog/blog.ts @@ -3,6 +3,6 @@ import { httpGetInterceptor } from "../http-config/http-interceptor-service"; export async function paginationBlog(size: number, page: number) { return await httpGetInterceptor( - `blog/pagination?enablePage=1&page=${page}&size=${size}` + `blog/pagination?enablePage=0&page=${page}&size=${size}` ); } diff --git a/service/communication/communication.ts b/service/communication/communication.ts index 88afe911..7740dc68 100644 --- a/service/communication/communication.ts +++ b/service/communication/communication.ts @@ -4,9 +4,9 @@ import { httpPostInterceptor, } from "../http-config/http-interceptor-service"; -export async function listTicketingInternal(page: number) { +export async function listTicketingInternal(page: number, size: any) { return await httpGetInterceptor( - `ticketing/internal/pagination?enablePage=1&size=10&page=${page}` + `ticketing/internal/pagination?enablePage=0&size=${size}&page=${page}` ); } diff --git a/service/content/content.ts b/service/content/content.ts index c218a2cb..63b66764 100644 --- a/service/content/content.ts +++ b/service/content/content.ts @@ -1,5 +1,8 @@ -import { getAPIInterceptor } from "@/config/api"; -import { httpGetInterceptor } from "../http-config/http-interceptor-service"; +import { getAPI, getAPIInterceptor, postAPI } from "@/config/api"; +import { + httpGetInterceptor, + httpGetInterceptorWithToken, +} from "../http-config/http-interceptor-service"; export async function listDataImage( page: any, @@ -15,7 +18,7 @@ export async function listDataImage( endDate: any ) { return await httpGetInterceptor( - `media/list?enablePage=1&sortBy=createdAt&sort=desc&size=${limit}&page=${page}&typeId=1&isForSelf=${isForSelf}&isApproval=${isApproval}&categoryId=${categoryFilter}&statusId=${statusFilter}&needApprovalFromLevel=${needApprovalFromLevel}&creatorUserLevelName=${source}&creatorName=${creator}&startDate=${startDate}&endDate=${endDate}` + `media/list?enablePage=0&sortBy=createdAt&sort=desc&size=${limit}&page=${page}&typeId=1&isForSelf=${isForSelf}&isApproval=${isApproval}&categoryId=${categoryFilter}&statusId=${statusFilter}&needApprovalFromLevel=${needApprovalFromLevel}&creatorUserLevelName=${source}&creatorName=${creator}&startDate=${startDate}&endDate=${endDate}` ); } @@ -33,7 +36,7 @@ export async function listDataVideo( endDate: any ) { return await httpGetInterceptor( - `media/list?enablePage=1&sortBy=createdAt&sort=desc&size=${limit}&page=${page}&typeId=2&isForSelf=${isForSelf}&isApproval=${isApproval}&categoryId=${categoryFilter}&statusId=${statusFilter}&needApprovalFromLevel=${needApprovalFromLevel}&creatorUserLevelName=${source}&creatorName=${creator}&startDate=${startDate}&endDate=${endDate}` + `media/list?enablePage=0&sortBy=createdAt&sort=desc&size=${limit}&page=${page}&typeId=2&isForSelf=${isForSelf}&isApproval=${isApproval}&categoryId=${categoryFilter}&statusId=${statusFilter}&needApprovalFromLevel=${needApprovalFromLevel}&creatorUserLevelName=${source}&creatorName=${creator}&startDate=${startDate}&endDate=${endDate}` ); } @@ -51,7 +54,7 @@ export async function listDataTeks( endDate: any ) { return await httpGetInterceptor( - `media/list?enablePage=1&sortBy=createdAt&sort=desc&size=${limit}&page=${page}&typeId=3&isForSelf=${isForSelf}&isApproval=${isApproval}&categoryId=${categoryFilter}&statusId=${statusFilter}&needApprovalFromLevel=${needApprovalFromLevel}&creatorUserLevelName=${source}&creatorName=${creator}&startDate=${startDate}&endDate=${endDate}` + `media/list?enablePage=0&sortBy=createdAt&sort=desc&size=${limit}&page=${page}&typeId=3&isForSelf=${isForSelf}&isApproval=${isApproval}&categoryId=${categoryFilter}&statusId=${statusFilter}&needApprovalFromLevel=${needApprovalFromLevel}&creatorUserLevelName=${source}&creatorName=${creator}&startDate=${startDate}&endDate=${endDate}` ); } @@ -69,7 +72,7 @@ export async function listDataAudio( endDate: any ) { return await httpGetInterceptor( - `media/list?enablePage=1&sortBy=createdAt&sort=desc&size=${limit}&page=${page}&typeId=4&isForSelf=${isForSelf}&isApproval=${isApproval}&categoryId=${categoryFilter}&statusId=${statusFilter}&needApprovalFromLevel=${needApprovalFromLevel}&creatorUserLevelName=${source}&creatorName=${creator}&startDate=${startDate}&endDate=${endDate}` + `media/list?enablePage=0&sortBy=createdAt&sort=desc&size=${limit}&page=${page}&typeId=4&isForSelf=${isForSelf}&isApproval=${isApproval}&categoryId=${categoryFilter}&statusId=${statusFilter}&needApprovalFromLevel=${needApprovalFromLevel}&creatorUserLevelName=${source}&creatorName=${creator}&startDate=${startDate}&endDate=${endDate}` ); } @@ -83,3 +86,14 @@ export async function listSPIT( `media/spit/pagination?enablePage=1&page=${page}&size=${limit}&sort=desc&sortBy=contentTitleId&title=${title}&isPublish=${isPublish}` ); } + +export async function getTagsBySubCategoryId(subCategory: any) { + return await httpGetInterceptor( + `media/tags/list?subCategoryId=${subCategory}` + ); +} + +export async function listEnableCategory(type: any) { + const url = `media/categories/list/enable?enablePage=0&sort=desc&sortBy=id&type=${type}`; + return getAPIInterceptor(url); +} diff --git a/service/planning/planning.ts b/service/planning/planning.ts index 8f1cde59..ef066f24 100644 --- a/service/planning/planning.ts +++ b/service/planning/planning.ts @@ -6,6 +6,6 @@ export async function getPlanningSentPagination( typeId: number ) { return await httpGetInterceptor( - `planning/pagination/sent?enablePage=1&size=${size}&page=${page}&typeId=${typeId}` + `planning/pagination/sent?enablePage=0&size=${size}&page=${page}&typeId=${typeId}` ); } diff --git a/service/schedule/schedule.ts b/service/schedule/schedule.ts new file mode 100644 index 00000000..a1e45e38 --- /dev/null +++ b/service/schedule/schedule.ts @@ -0,0 +1,13 @@ +import { title } from "process"; +import { httpGetInterceptor } from "../http-config/http-interceptor-service"; +import { type } from "os"; + +export async function paginationSchedule( + size: number, + page: number, + type: any +) { + return await httpGetInterceptor( + `schedule/pagination?enablePage=1&scheduleTypeId=${type}&page=${page}&size=${size}` + ); +} diff --git a/service/task.ts b/service/task.ts index 369f407c..b9ab0d28 100644 --- a/service/task.ts +++ b/service/task.ts @@ -16,7 +16,7 @@ import { // } export async function listTask(page: any, limit: any) { - const url = `assignment/list?size=${limit}&page=${page}`; + const url = `assignment/list?enablePage=0&size=${limit}&page=${page}`; return getAPIInterceptor(url); }