feat:add table:schedule and fix bug table
This commit is contained in:
parent
4d3d934197
commit
b04ff4743a
|
|
@ -56,7 +56,6 @@ export type CompanyData = {
|
||||||
import { data } from "./data";
|
import { data } from "./data";
|
||||||
import { Input } from "@/components/ui/input";
|
import { Input } from "@/components/ui/input";
|
||||||
import { InputGroup, InputGroupText } from "@/components/ui/input-group";
|
import { InputGroup, InputGroupText } from "@/components/ui/input-group";
|
||||||
import { listTask } from "@/service/ppid-categories-services";
|
|
||||||
import { paginationBlog } from "@/service/blog/blog";
|
import { paginationBlog } from "@/service/blog/blog";
|
||||||
|
|
||||||
export const columns: ColumnDef<CompanyData>[] = [
|
export const columns: ColumnDef<CompanyData>[] = [
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,7 @@ import {
|
||||||
export type CompanyData = {
|
export type CompanyData = {
|
||||||
no: number;
|
no: number;
|
||||||
title: string;
|
title: string;
|
||||||
commentFromUserName: string;
|
createdBy: string;
|
||||||
commentToUserName: string;
|
commentToUserName: string;
|
||||||
createdAt: string;
|
createdAt: string;
|
||||||
};
|
};
|
||||||
|
|
@ -86,21 +86,17 @@ export const columns: ColumnDef<CompanyData>[] = [
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
accessorKey: "commentFromUserName",
|
accessorKey: "createdBy",
|
||||||
header: "Pengirim ",
|
header: "Pengirim ",
|
||||||
cell: ({ row }) => (
|
cell: ({ row }) => (
|
||||||
<span className="whitespace-nowrap">
|
<span className="whitespace-nowrap">{row.getValue("createdBy")}</span>
|
||||||
{row.getValue("commentFromUserName")}
|
|
||||||
</span>
|
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
accessorKey: "commentToUserName",
|
accessorKey: "sendTo",
|
||||||
header: "Penerima",
|
header: "Penerima",
|
||||||
cell: ({ row }) => (
|
cell: ({ row }) => (
|
||||||
<span className="whitespace-nowrap">
|
<span className="whitespace-nowrap">{row.getValue("sendTo")}</span>
|
||||||
{row.getValue("commentToUserName")}
|
|
||||||
</span>
|
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
@ -158,7 +154,7 @@ const InternalTable = () => {
|
||||||
const [rowSelection, setRowSelection] = React.useState({});
|
const [rowSelection, setRowSelection] = React.useState({});
|
||||||
const [pagination, setPagination] = React.useState<PaginationState>({
|
const [pagination, setPagination] = React.useState<PaginationState>({
|
||||||
pageIndex: 0,
|
pageIndex: 0,
|
||||||
pageSize: 6,
|
pageSize: 10,
|
||||||
});
|
});
|
||||||
const [page, setPage] = React.useState(1);
|
const [page, setPage] = React.useState(1);
|
||||||
const [totalPage, setTotalPage] = React.useState(1);
|
const [totalPage, setTotalPage] = React.useState(1);
|
||||||
|
|
@ -191,9 +187,8 @@ const InternalTable = () => {
|
||||||
|
|
||||||
async function initState() {
|
async function initState() {
|
||||||
try {
|
try {
|
||||||
const res = await listTicketingInternal(page);
|
const res = await listTicketingInternal(limit, page);
|
||||||
|
const data = res.data.data.content.map((item: any, index: number) => ({
|
||||||
const data = res.data.content.map((item: any, index: number) => ({
|
|
||||||
no: (page - 1) * limit + index + 1,
|
no: (page - 1) * limit + index + 1,
|
||||||
title: item.title,
|
title: item.title,
|
||||||
commentFromUserName: item.commentFromUserName,
|
commentFromUserName: item.commentFromUserName,
|
||||||
|
|
|
||||||
|
|
@ -210,7 +210,7 @@ const TableImage = () => {
|
||||||
pageIndex: 0, // Halaman pertama
|
pageIndex: 0, // Halaman pertama
|
||||||
pageSize: 10, // Jumlah baris per halaman
|
pageSize: 10, // Jumlah baris per halaman
|
||||||
});
|
});
|
||||||
const [totalPage, setTotalPage] = React.useState<number>(1);
|
const [totalPage, setTotalPage] = React.useState<number>(10);
|
||||||
const [limit, setLimit] = React.useState<number>(10); // Jumlah baris per halaman
|
const [limit, setLimit] = React.useState<number>(10); // Jumlah baris per halaman
|
||||||
const [search, setSearch] = React.useState<string>("");
|
const [search, setSearch] = React.useState<string>("");
|
||||||
const userId = getCookiesDecrypt("uie");
|
const userId = getCookiesDecrypt("uie");
|
||||||
|
|
|
||||||
|
|
@ -54,8 +54,6 @@ export type CompanyData = {
|
||||||
import { data } from "./data";
|
import { data } from "./data";
|
||||||
import { Input } from "@/components/ui/input";
|
import { Input } from "@/components/ui/input";
|
||||||
import { InputGroup, InputGroupText } from "@/components/ui/input-group";
|
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";
|
import { getPlanningSentPagination } from "@/service/planning/planning";
|
||||||
|
|
||||||
export const columns: ColumnDef<CompanyData>[] = [
|
export const columns: ColumnDef<CompanyData>[] = [
|
||||||
|
|
|
||||||
|
|
@ -46,11 +46,12 @@ import {
|
||||||
} from "@/components/ui/dropdown-menu";
|
} from "@/components/ui/dropdown-menu";
|
||||||
|
|
||||||
export type CompanyData = {
|
export type CompanyData = {
|
||||||
|
no: number;
|
||||||
title: string;
|
title: string;
|
||||||
startDate: string;
|
startDate: string;
|
||||||
endDate: string;
|
endDate: string;
|
||||||
time: string;
|
startTime: string;
|
||||||
loccation: string;
|
address: string;
|
||||||
speakerName: string;
|
speakerName: string;
|
||||||
uploaderName: string;
|
uploaderName: string;
|
||||||
status: string;
|
status: string;
|
||||||
|
|
@ -58,8 +59,24 @@ export type CompanyData = {
|
||||||
import { data } from "./data";
|
import { data } from "./data";
|
||||||
import { Input } from "@/components/ui/input";
|
import { Input } from "@/components/ui/input";
|
||||||
import { InputGroup, InputGroupText } from "@/components/ui/input-group";
|
import { InputGroup, InputGroupText } from "@/components/ui/input-group";
|
||||||
|
import { paginationBlog } from "@/service/blog/blog";
|
||||||
|
import { paginationSchedule } from "@/service/schedule/schedule";
|
||||||
|
|
||||||
export const columns: ColumnDef<CompanyData>[] = [
|
export const columns: ColumnDef<CompanyData>[] = [
|
||||||
|
{
|
||||||
|
accessorKey: "no",
|
||||||
|
header: "No",
|
||||||
|
cell: ({ row }) => (
|
||||||
|
<div className="flex items-center gap-5">
|
||||||
|
<div className="flex-1 text-start">
|
||||||
|
<h4 className="text-sm font-medium text-default-600 whitespace-nowrap mb-1">
|
||||||
|
{row.getValue("no")}
|
||||||
|
</h4>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
accessorKey: "title",
|
accessorKey: "title",
|
||||||
header: "Judul",
|
header: "Judul",
|
||||||
|
|
@ -88,19 +105,30 @@ export const columns: ColumnDef<CompanyData>[] = [
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
accessorKey: "time",
|
accessorKey: "startTime",
|
||||||
header: "Waktu",
|
header: "Waktu",
|
||||||
cell: ({ row }) => (
|
cell: ({ row }) => (
|
||||||
<span className="whitespace-nowrap">{row.getValue("time")}</span>
|
<span className="whitespace-nowrap">{row.getValue("startTime")}</span>
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
accessorKey: "loccation",
|
accessorKey: "address",
|
||||||
header: "Lokasi",
|
header: "Lokasi",
|
||||||
cell: ({ row }) => (
|
cell: ({ row }) => (
|
||||||
<span className="whitespace-nowrap">{row.getValue("loccation")}</span>
|
<span className="whitespace-nowrap">{row.getValue("address")}</span>
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
accessorKey: "status",
|
||||||
|
header: "Status",
|
||||||
|
cell: ({ row }) => {
|
||||||
|
return (
|
||||||
|
<span className="whitespace-nowrap text-blue-600">
|
||||||
|
{row.getValue("status")}
|
||||||
|
</span>
|
||||||
|
);
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
accessorKey: "speakerName",
|
accessorKey: "speakerName",
|
||||||
header: "Disampaikan oleh",
|
header: "Disampaikan oleh",
|
||||||
|
|
@ -115,17 +143,7 @@ export const columns: ColumnDef<CompanyData>[] = [
|
||||||
<span className="whitespace-nowrap">{row.getValue("uploaderName")}</span>
|
<span className="whitespace-nowrap">{row.getValue("uploaderName")}</span>
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
{
|
|
||||||
accessorKey: "status",
|
|
||||||
header: "Status",
|
|
||||||
cell: ({ row }) => {
|
|
||||||
return (
|
|
||||||
<span className="whitespace-nowrap text-blue-600">
|
|
||||||
{row.getValue("status")}
|
|
||||||
</span>
|
|
||||||
);
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
id: "actions",
|
id: "actions",
|
||||||
accessorKey: "action",
|
accessorKey: "action",
|
||||||
|
|
@ -164,6 +182,7 @@ export const columns: ColumnDef<CompanyData>[] = [
|
||||||
];
|
];
|
||||||
|
|
||||||
const EventTable = () => {
|
const EventTable = () => {
|
||||||
|
const [eventTable, setEventTable] = React.useState<CompanyData[]>([]);
|
||||||
const [sorting, setSorting] = React.useState<SortingState>([]);
|
const [sorting, setSorting] = React.useState<SortingState>([]);
|
||||||
const [columnFilters, setColumnFilters] = React.useState<ColumnFiltersState>(
|
const [columnFilters, setColumnFilters] = React.useState<ColumnFiltersState>(
|
||||||
[]
|
[]
|
||||||
|
|
@ -173,11 +192,14 @@ const EventTable = () => {
|
||||||
const [rowSelection, setRowSelection] = React.useState({});
|
const [rowSelection, setRowSelection] = React.useState({});
|
||||||
const [pagination, setPagination] = React.useState<PaginationState>({
|
const [pagination, setPagination] = React.useState<PaginationState>({
|
||||||
pageIndex: 0,
|
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({
|
const table = useReactTable({
|
||||||
data,
|
data: eventTable,
|
||||||
columns,
|
columns,
|
||||||
onSortingChange: setSorting,
|
onSortingChange: setSorting,
|
||||||
onColumnFiltersChange: setColumnFilters,
|
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 (
|
return (
|
||||||
<div className="w-full overflow-x-auto">
|
<div className="w-full overflow-x-auto">
|
||||||
<div className="flex justify-between items-center py-4 px-5">
|
<div className="flex justify-between items-center py-4 px-5">
|
||||||
|
|
|
||||||
|
|
@ -46,11 +46,12 @@ import {
|
||||||
} from "@/components/ui/dropdown-menu";
|
} from "@/components/ui/dropdown-menu";
|
||||||
|
|
||||||
export type CompanyData = {
|
export type CompanyData = {
|
||||||
|
no: number;
|
||||||
title: string;
|
title: string;
|
||||||
startDate: string;
|
startDate: string;
|
||||||
endDate: string;
|
endDate: string;
|
||||||
time: string;
|
startTime: string;
|
||||||
loccation: string;
|
address: string;
|
||||||
speakerName: string;
|
speakerName: string;
|
||||||
uploaderName: string;
|
uploaderName: string;
|
||||||
status: string;
|
status: string;
|
||||||
|
|
@ -58,8 +59,24 @@ export type CompanyData = {
|
||||||
import { data } from "./data";
|
import { data } from "./data";
|
||||||
import { Input } from "@/components/ui/input";
|
import { Input } from "@/components/ui/input";
|
||||||
import { InputGroup, InputGroupText } from "@/components/ui/input-group";
|
import { InputGroup, InputGroupText } from "@/components/ui/input-group";
|
||||||
|
import { paginationBlog } from "@/service/blog/blog";
|
||||||
|
import { paginationSchedule } from "@/service/schedule/schedule";
|
||||||
|
|
||||||
export const columns: ColumnDef<CompanyData>[] = [
|
export const columns: ColumnDef<CompanyData>[] = [
|
||||||
|
{
|
||||||
|
accessorKey: "no",
|
||||||
|
header: "No",
|
||||||
|
cell: ({ row }) => (
|
||||||
|
<div className="flex items-center gap-5">
|
||||||
|
<div className="flex-1 text-start">
|
||||||
|
<h4 className="text-sm font-medium text-default-600 whitespace-nowrap mb-1">
|
||||||
|
{row.getValue("no")}
|
||||||
|
</h4>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
accessorKey: "title",
|
accessorKey: "title",
|
||||||
header: "Judul",
|
header: "Judul",
|
||||||
|
|
@ -88,19 +105,30 @@ export const columns: ColumnDef<CompanyData>[] = [
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
accessorKey: "time",
|
accessorKey: "startTime",
|
||||||
header: "Waktu",
|
header: "Waktu",
|
||||||
cell: ({ row }) => (
|
cell: ({ row }) => (
|
||||||
<span className="whitespace-nowrap">{row.getValue("time")}</span>
|
<span className="whitespace-nowrap">{row.getValue("startTime")}</span>
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
accessorKey: "loccation",
|
accessorKey: "address",
|
||||||
header: "Lokasi",
|
header: "Lokasi",
|
||||||
cell: ({ row }) => (
|
cell: ({ row }) => (
|
||||||
<span className="whitespace-nowrap">{row.getValue("loccation")}</span>
|
<span className="whitespace-nowrap">{row.getValue("address")}</span>
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
accessorKey: "status",
|
||||||
|
header: "Status",
|
||||||
|
cell: ({ row }) => {
|
||||||
|
return (
|
||||||
|
<span className="whitespace-nowrap text-blue-600">
|
||||||
|
{row.getValue("status")}
|
||||||
|
</span>
|
||||||
|
);
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
accessorKey: "speakerName",
|
accessorKey: "speakerName",
|
||||||
header: "Disampaikan oleh",
|
header: "Disampaikan oleh",
|
||||||
|
|
@ -115,17 +143,7 @@ export const columns: ColumnDef<CompanyData>[] = [
|
||||||
<span className="whitespace-nowrap">{row.getValue("uploaderName")}</span>
|
<span className="whitespace-nowrap">{row.getValue("uploaderName")}</span>
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
{
|
|
||||||
accessorKey: "status",
|
|
||||||
header: "Status",
|
|
||||||
cell: ({ row }) => {
|
|
||||||
return (
|
|
||||||
<span className="whitespace-nowrap text-blue-600">
|
|
||||||
{row.getValue("status")}
|
|
||||||
</span>
|
|
||||||
);
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
id: "actions",
|
id: "actions",
|
||||||
accessorKey: "action",
|
accessorKey: "action",
|
||||||
|
|
@ -163,7 +181,8 @@ export const columns: ColumnDef<CompanyData>[] = [
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
const PressReleaseTable = () => {
|
const PressConTable = () => {
|
||||||
|
const [pressconTable, setPressConTable] = React.useState<CompanyData[]>([]);
|
||||||
const [sorting, setSorting] = React.useState<SortingState>([]);
|
const [sorting, setSorting] = React.useState<SortingState>([]);
|
||||||
const [columnFilters, setColumnFilters] = React.useState<ColumnFiltersState>(
|
const [columnFilters, setColumnFilters] = React.useState<ColumnFiltersState>(
|
||||||
[]
|
[]
|
||||||
|
|
@ -173,11 +192,14 @@ const PressReleaseTable = () => {
|
||||||
const [rowSelection, setRowSelection] = React.useState({});
|
const [rowSelection, setRowSelection] = React.useState({});
|
||||||
const [pagination, setPagination] = React.useState<PaginationState>({
|
const [pagination, setPagination] = React.useState<PaginationState>({
|
||||||
pageIndex: 0,
|
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({
|
const table = useReactTable({
|
||||||
data,
|
data: pressconTable,
|
||||||
columns,
|
columns,
|
||||||
onSortingChange: setSorting,
|
onSortingChange: setSorting,
|
||||||
onColumnFiltersChange: setColumnFilters,
|
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 (
|
return (
|
||||||
<div className="w-full overflow-x-auto">
|
<div className="w-full overflow-x-auto">
|
||||||
<div className="flex justify-between items-center py-4 px-5">
|
<div className="flex justify-between items-center py-4 px-5">
|
||||||
|
|
@ -305,4 +352,4 @@ const PressReleaseTable = () => {
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export default PressReleaseTable;
|
export default PressConTable;
|
||||||
|
|
|
||||||
|
|
@ -46,11 +46,12 @@ import {
|
||||||
} from "@/components/ui/dropdown-menu";
|
} from "@/components/ui/dropdown-menu";
|
||||||
|
|
||||||
export type CompanyData = {
|
export type CompanyData = {
|
||||||
|
no: number;
|
||||||
title: string;
|
title: string;
|
||||||
startDate: string;
|
startDate: string;
|
||||||
endDate: string;
|
endDate: string;
|
||||||
time: string;
|
startTime: string;
|
||||||
loccation: string;
|
address: string;
|
||||||
speakerName: string;
|
speakerName: string;
|
||||||
uploaderName: string;
|
uploaderName: string;
|
||||||
status: string;
|
status: string;
|
||||||
|
|
@ -58,8 +59,24 @@ export type CompanyData = {
|
||||||
import { data } from "./data";
|
import { data } from "./data";
|
||||||
import { Input } from "@/components/ui/input";
|
import { Input } from "@/components/ui/input";
|
||||||
import { InputGroup, InputGroupText } from "@/components/ui/input-group";
|
import { InputGroup, InputGroupText } from "@/components/ui/input-group";
|
||||||
|
import { paginationBlog } from "@/service/blog/blog";
|
||||||
|
import { paginationSchedule } from "@/service/schedule/schedule";
|
||||||
|
|
||||||
export const columns: ColumnDef<CompanyData>[] = [
|
export const columns: ColumnDef<CompanyData>[] = [
|
||||||
|
{
|
||||||
|
accessorKey: "no",
|
||||||
|
header: "No",
|
||||||
|
cell: ({ row }) => (
|
||||||
|
<div className="flex items-center gap-5">
|
||||||
|
<div className="flex-1 text-start">
|
||||||
|
<h4 className="text-sm font-medium text-default-600 whitespace-nowrap mb-1">
|
||||||
|
{row.getValue("no")}
|
||||||
|
</h4>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
accessorKey: "title",
|
accessorKey: "title",
|
||||||
header: "Judul",
|
header: "Judul",
|
||||||
|
|
@ -88,19 +105,30 @@ export const columns: ColumnDef<CompanyData>[] = [
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
accessorKey: "time",
|
accessorKey: "startTime",
|
||||||
header: "Waktu",
|
header: "Waktu",
|
||||||
cell: ({ row }) => (
|
cell: ({ row }) => (
|
||||||
<span className="whitespace-nowrap">{row.getValue("time")}</span>
|
<span className="whitespace-nowrap">{row.getValue("startTime")}</span>
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
accessorKey: "loccation",
|
accessorKey: "address",
|
||||||
header: "Lokasi",
|
header: "Lokasi",
|
||||||
cell: ({ row }) => (
|
cell: ({ row }) => (
|
||||||
<span className="whitespace-nowrap">{row.getValue("loccation")}</span>
|
<span className="whitespace-nowrap">{row.getValue("address")}</span>
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
accessorKey: "status",
|
||||||
|
header: "Status",
|
||||||
|
cell: ({ row }) => {
|
||||||
|
return (
|
||||||
|
<span className="whitespace-nowrap text-blue-600">
|
||||||
|
{row.getValue("status")}
|
||||||
|
</span>
|
||||||
|
);
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
accessorKey: "speakerName",
|
accessorKey: "speakerName",
|
||||||
header: "Disampaikan oleh",
|
header: "Disampaikan oleh",
|
||||||
|
|
@ -115,17 +143,7 @@ export const columns: ColumnDef<CompanyData>[] = [
|
||||||
<span className="whitespace-nowrap">{row.getValue("uploaderName")}</span>
|
<span className="whitespace-nowrap">{row.getValue("uploaderName")}</span>
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
{
|
|
||||||
accessorKey: "status",
|
|
||||||
header: "Status",
|
|
||||||
cell: ({ row }) => {
|
|
||||||
return (
|
|
||||||
<span className="whitespace-nowrap text-blue-600">
|
|
||||||
{row.getValue("status")}
|
|
||||||
</span>
|
|
||||||
);
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
id: "actions",
|
id: "actions",
|
||||||
accessorKey: "action",
|
accessorKey: "action",
|
||||||
|
|
@ -163,7 +181,10 @@ export const columns: ColumnDef<CompanyData>[] = [
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
const PressConferenceTable = () => {
|
const PressReleaseTable = () => {
|
||||||
|
const [pressReleaseTable, setPressReleaseTable] = React.useState<
|
||||||
|
CompanyData[]
|
||||||
|
>([]);
|
||||||
const [sorting, setSorting] = React.useState<SortingState>([]);
|
const [sorting, setSorting] = React.useState<SortingState>([]);
|
||||||
const [columnFilters, setColumnFilters] = React.useState<ColumnFiltersState>(
|
const [columnFilters, setColumnFilters] = React.useState<ColumnFiltersState>(
|
||||||
[]
|
[]
|
||||||
|
|
@ -173,11 +194,14 @@ const PressConferenceTable = () => {
|
||||||
const [rowSelection, setRowSelection] = React.useState({});
|
const [rowSelection, setRowSelection] = React.useState({});
|
||||||
const [pagination, setPagination] = React.useState<PaginationState>({
|
const [pagination, setPagination] = React.useState<PaginationState>({
|
||||||
pageIndex: 0,
|
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({
|
const table = useReactTable({
|
||||||
data,
|
data: pressReleaseTable,
|
||||||
columns,
|
columns,
|
||||||
onSortingChange: setSorting,
|
onSortingChange: setSorting,
|
||||||
onColumnFiltersChange: setColumnFilters,
|
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 (
|
return (
|
||||||
<div className="w-full overflow-x-auto">
|
<div className="w-full overflow-x-auto">
|
||||||
<div className="flex justify-between items-center py-4 px-5">
|
<div className="flex justify-between items-center py-4 px-5">
|
||||||
|
|
@ -305,4 +354,4 @@ const PressConferenceTable = () => {
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export default PressConferenceTable;
|
export default PressReleaseTable;
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
"use client";
|
"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 { useForm, Controller } from "react-hook-form";
|
||||||
import { Input } from "@/components/ui/input";
|
import { Input } from "@/components/ui/input";
|
||||||
import { Button } from "@/components/ui/button";
|
import { Button } from "@/components/ui/button";
|
||||||
|
|
@ -22,36 +22,49 @@ import { RadioGroup, RadioGroupItem } from "@/components/ui/radio-group";
|
||||||
import JoditEditor from "jodit-react";
|
import JoditEditor from "jodit-react";
|
||||||
import { register } from "module";
|
import { register } from "module";
|
||||||
import { Switch } from "@/components/ui/switch";
|
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({
|
const taskSchema = z.object({
|
||||||
title: z.string().min(1, { message: "Judul diperlukan" }),
|
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.",
|
message: "Narasi Penugasan harus lebih dari 2 karakter.",
|
||||||
}),
|
}),
|
||||||
|
categoryId: z.string().min(1, { message: "Judul diperlukan" }),
|
||||||
creator: z.string().min(1, { message: "Judul diperlukan" }),
|
creator: z.string().min(1, { message: "Judul diperlukan" }),
|
||||||
tags: 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() {
|
export default function FormImage() {
|
||||||
const MySwal = withReactContent(Swal);
|
const MySwal = withReactContent(Swal);
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const editor = useRef(null);
|
const editor = useRef(null);
|
||||||
type TaskSchema = z.infer<typeof taskSchema>;
|
type TaskSchema = z.infer<typeof taskSchema>;
|
||||||
const [tags, setTags] = useState<string[]>([]);
|
|
||||||
const [selectedFiles, setSelectedFiles] = useState<File[]>([]);
|
|
||||||
|
|
||||||
// State for various form fields
|
const [selectedFiles, setSelectedFiles] = useState<File[]>([]);
|
||||||
const [output, setOutput] = useState({
|
const taskId = Cookies.get("taskId");
|
||||||
all: false,
|
|
||||||
video: false,
|
|
||||||
audio: false,
|
|
||||||
image: false,
|
|
||||||
text: false,
|
|
||||||
});
|
|
||||||
|
|
||||||
const [assignmentType, setAssignmentType] = useState("mediahub");
|
const [assignmentType, setAssignmentType] = useState("mediahub");
|
||||||
const [assignmentCategory, setAssignmentCategory] = useState("publication");
|
const [assignmentCategory, setAssignmentCategory] = useState("publication");
|
||||||
|
|
||||||
|
const scheduleId = Cookies.get("scheduleId");
|
||||||
|
const scheduleType = Cookies.get("scheduleType");
|
||||||
|
|
||||||
|
const [categories, setCategories] = useState<Category[]>([]);
|
||||||
|
const [selectedCategory, setSelectedCategory] = useState<
|
||||||
|
string | undefined
|
||||||
|
>();
|
||||||
|
const [tags, setTags] = useState<any[]>([]);
|
||||||
|
|
||||||
const [selectedTarget, setSelectedTarget] = useState("all");
|
const [selectedTarget, setSelectedTarget] = useState("all");
|
||||||
const [unitSelection, setUnitSelection] = useState({
|
const [unitSelection, setUnitSelection] = useState({
|
||||||
allUnit: false,
|
allUnit: false,
|
||||||
|
|
@ -60,6 +73,8 @@ export default function FormImage() {
|
||||||
polres: false,
|
polres: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
let fileTypeId = "";
|
||||||
|
|
||||||
const {
|
const {
|
||||||
control,
|
control,
|
||||||
handleSubmit,
|
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) => {
|
const handleRemoveImage = (index: number) => {
|
||||||
setSelectedFiles((prevImages) => prevImages.filter((_, i) => i !== index));
|
setSelectedFiles((prevImages) => prevImages.filter((_, i) => i !== index));
|
||||||
};
|
};
|
||||||
|
|
@ -99,7 +153,6 @@ export default function FormImage() {
|
||||||
const save = async (data: TaskSchema) => {
|
const save = async (data: TaskSchema) => {
|
||||||
const requestData = {
|
const requestData = {
|
||||||
...data,
|
...data,
|
||||||
output,
|
|
||||||
assignmentType,
|
assignmentType,
|
||||||
assignmentCategory,
|
assignmentCategory,
|
||||||
target: selectedTarget,
|
target: selectedTarget,
|
||||||
|
|
@ -164,26 +217,46 @@ export default function FormImage() {
|
||||||
</div>
|
</div>
|
||||||
<div className="flex items-center">
|
<div className="flex items-center">
|
||||||
<div className="py-3 w-full">
|
<div className="py-3 w-full">
|
||||||
<Label>Kategory</Label>
|
<Label>Kategori</Label>
|
||||||
<Select onValueChange={setSelectedTarget}>
|
<Controller
|
||||||
<SelectTrigger size="md">
|
name="categoryId"
|
||||||
<SelectValue placeholder="Pilih" />
|
control={control}
|
||||||
</SelectTrigger>
|
render={({ field }) => (
|
||||||
<SelectContent>
|
<Select
|
||||||
<SelectItem value="all">Mediapool</SelectItem>
|
value={field.value} // Pastikan nilai berasal dari form state
|
||||||
<SelectItem value="contributor">
|
onValueChange={(value) => {
|
||||||
Liputan Kegiatan
|
setSelectedCategory(value); // Perbarui state lokal
|
||||||
</SelectItem>
|
field.onChange(value); // Perbarui form state
|
||||||
<SelectItem value="approver">Press Tour</SelectItem>
|
}}
|
||||||
</SelectContent>
|
>
|
||||||
</Select>
|
<SelectTrigger size="md">
|
||||||
|
<SelectValue>
|
||||||
|
{categories.find((cat) => cat.id === field.value)
|
||||||
|
?.name || "Pilih"}
|
||||||
|
</SelectValue>
|
||||||
|
</SelectTrigger>
|
||||||
|
<SelectContent>
|
||||||
|
{categories.map((category) => (
|
||||||
|
<SelectItem key={category.id} value={category.id}>
|
||||||
|
{category.name}
|
||||||
|
</SelectItem>
|
||||||
|
))}
|
||||||
|
</SelectContent>
|
||||||
|
</Select>
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
{errors.categoryId?.message && (
|
||||||
|
<p className="text-red-400 text-sm">
|
||||||
|
{errors.categoryId.message}
|
||||||
|
</p>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="py-3">
|
<div className="py-3">
|
||||||
<Label>Deskripsi</Label>
|
<Label>Deskripsi</Label>
|
||||||
<Controller
|
<Controller
|
||||||
control={control}
|
control={control}
|
||||||
name="naration"
|
name="description"
|
||||||
render={({ field: { onChange, value } }) => (
|
render={({ field: { onChange, value } }) => (
|
||||||
<JoditEditor
|
<JoditEditor
|
||||||
ref={editor}
|
ref={editor}
|
||||||
|
|
@ -193,9 +266,9 @@ export default function FormImage() {
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
{errors.naration?.message && (
|
{errors.description?.message && (
|
||||||
<p className="text-red-400 text-sm">
|
<p className="text-red-400 text-sm">
|
||||||
{errors.naration.message}
|
{errors.description.message}
|
||||||
</p>
|
</p>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,3 @@
|
||||||
import Cookies from "js-cookie";
|
|
||||||
|
|
||||||
import { getAPI, postAPI, postAPIWithJson } from "../config/api";
|
import { getAPI, postAPI, postAPIWithJson } from "../config/api";
|
||||||
import { getAPIDummy } from "./http-config/axiosCustom";
|
import { getAPIDummy } from "./http-config/axiosCustom";
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,6 @@ import { httpGetInterceptor } from "../http-config/http-interceptor-service";
|
||||||
|
|
||||||
export async function paginationBlog(size: number, page: number) {
|
export async function paginationBlog(size: number, page: number) {
|
||||||
return await httpGetInterceptor(
|
return await httpGetInterceptor(
|
||||||
`blog/pagination?enablePage=1&page=${page}&size=${size}`
|
`blog/pagination?enablePage=0&page=${page}&size=${size}`
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,9 +4,9 @@ import {
|
||||||
httpPostInterceptor,
|
httpPostInterceptor,
|
||||||
} from "../http-config/http-interceptor-service";
|
} from "../http-config/http-interceptor-service";
|
||||||
|
|
||||||
export async function listTicketingInternal(page: number) {
|
export async function listTicketingInternal(page: number, size: any) {
|
||||||
return await httpGetInterceptor(
|
return await httpGetInterceptor(
|
||||||
`ticketing/internal/pagination?enablePage=1&size=10&page=${page}`
|
`ticketing/internal/pagination?enablePage=0&size=${size}&page=${page}`
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,8 @@
|
||||||
import { getAPIInterceptor } from "@/config/api";
|
import { getAPI, getAPIInterceptor, postAPI } from "@/config/api";
|
||||||
import { httpGetInterceptor } from "../http-config/http-interceptor-service";
|
import {
|
||||||
|
httpGetInterceptor,
|
||||||
|
httpGetInterceptorWithToken,
|
||||||
|
} from "../http-config/http-interceptor-service";
|
||||||
|
|
||||||
export async function listDataImage(
|
export async function listDataImage(
|
||||||
page: any,
|
page: any,
|
||||||
|
|
@ -15,7 +18,7 @@ export async function listDataImage(
|
||||||
endDate: any
|
endDate: any
|
||||||
) {
|
) {
|
||||||
return await httpGetInterceptor(
|
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
|
endDate: any
|
||||||
) {
|
) {
|
||||||
return await httpGetInterceptor(
|
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
|
endDate: any
|
||||||
) {
|
) {
|
||||||
return await httpGetInterceptor(
|
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
|
endDate: any
|
||||||
) {
|
) {
|
||||||
return await httpGetInterceptor(
|
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}`
|
`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);
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,6 @@ export async function getPlanningSentPagination(
|
||||||
typeId: number
|
typeId: number
|
||||||
) {
|
) {
|
||||||
return await httpGetInterceptor(
|
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}`
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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}`
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
@ -16,7 +16,7 @@ import {
|
||||||
// }
|
// }
|
||||||
|
|
||||||
export async function listTask(page: any, limit: any) {
|
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);
|
return getAPIInterceptor(url);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue