fix:generate article

This commit is contained in:
Rama Priyanto 2025-02-10 16:16:52 +07:00
parent c49450e704
commit e88453c069
33 changed files with 515 additions and 98 deletions

View File

@ -108,6 +108,7 @@ export default function CreateArticleForm() {
const [filesValidation, setFileValidation] = useState("");
const [diseData, setDiseData] = useState<DiseData>();
const [selectedWritingType, setSelectedWritingType] = useState("single");
const [status, setStatus] = useState<"publish" | "draft">("publish");
const { getRootProps, getInputProps } = useDropzone({
onDrop: (acceptedFiles) => {
@ -269,6 +270,8 @@ export default function CreateArticleForm() {
description: htmlToString(removeImgTags(values.description)),
htmlDescription: removeImgTags(values.description),
aiArticleId: await saveArticleToDise(values),
isDraft: status === "draft",
isPublish: status === "publish",
};
const response = await createArticle(formData);
@ -749,10 +752,18 @@ export default function CreateArticleForm() {
)}
</div>
<div className="flex flex-row justify-end gap-3">
<Button color="primary" type="submit">
<Button
color="primary"
type="submit"
onClick={() => setStatus("publish")}
>
Publish
</Button>
<Button color="success" type="button">
<Button
color="success"
type="submit"
onClick={() => setStatus("draft")}
>
<p className="text-white">Draft</p>
</Button>
<Link href="/admin/article">

View File

@ -20,6 +20,7 @@ import {
} from "@/service/generate-article";
import { delay } from "@/utils/global";
import dynamic from "next/dynamic";
import GetSeoScore from "./get-seo-score-form";
const CustomEditor = dynamic(
() => {
@ -242,19 +243,21 @@ export default function GenerateContentRewriteForm(props: {
{mainKeyword == "" && (
<p className="text-red-400 text-sm">Required</p>
)}
<Button
color="primary"
className="my-5 w-full py-5 text-xs md:text-base"
type="button"
onPress={onSubmit}
isDisabled={mainKeyword == ""}
>
Generate
</Button>
{articleIds.length < 3 && (
<Button
color="primary"
className="my-5 w-full py-5 text-xs md:text-base"
type="button"
onPress={onSubmit}
isDisabled={mainKeyword == ""}
>
Generate
</Button>
)}
</div>
{articleIds.length > 0 && (
<div className="flex flex-row gap-1">
{articleIds?.map((id) => (
<div className="flex flex-row gap-1 mt-2">
{articleIds?.map((id, index) => (
<Button
onPress={() => setSelectedId(id)}
key={id}
@ -268,12 +271,17 @@ export default function GenerateContentRewriteForm(props: {
}
>
<p className={selectedId == id ? "text-white" : "text-black"}>
{id}
Article {index + 1}
</p>
</Button>
))}
</div>
)}
{!isLoading && (
<div>
<GetSeoScore id={String(selectedId)} />
</div>
)}
</form>
</fieldset>
);

View File

@ -18,6 +18,7 @@ import {
getGenerateTitle,
} from "@/service/generate-article";
import { delay } from "@/utils/global";
import GetSeoScore from "./get-seo-score-form";
const writingStyle = [
{
@ -374,20 +375,22 @@ export default function GenerateSingleArticleForm(props: {
{/* {additionalKeyword == "" && (
<p className="text-red-400 text-sm">Required</p>
)} */}
<Button
color="primary"
className="my-5 w-full py-5 text-xs md:text-base"
type="button"
onPress={onSubmit}
isDisabled={
mainKeyword == "" || title == "" || additionalKeyword == ""
}
>
Generate
</Button>
{articleIds.length < 3 && (
<Button
color="primary"
className="my-5 w-full py-5 text-xs md:text-base"
type="button"
onPress={onSubmit}
isDisabled={
mainKeyword == "" || title == "" || additionalKeyword == ""
}
>
Generate
</Button>
)}
</div>
{articleIds.length > 0 && (
<div className="flex flex-row gap-1">
<div className="flex flex-row gap-1 mt-2">
{articleIds?.map((id, index) => (
<Button
onPress={() => setSelectedId(id)}
@ -402,12 +405,17 @@ export default function GenerateSingleArticleForm(props: {
}
>
<p className={selectedId == id ? "text-white" : "text-black"}>
Article {index}
Article {index + 1}
</p>
</Button>
))}
</div>
)}
{!isLoading && (
<div>
<GetSeoScore id={String(selectedId)} />
</div>
)}
</form>
</fieldset>
);

View File

@ -3,6 +3,7 @@ import CategorySatker from "./CategorySatker";
import ENewsPolri from "./ENewsPolri";
import MediaSocial from "./MediaSocial";
import MedolUpdate from "./MedolUpdate";
import PolriApps from "./PolriApps";
import RegionalNews from "./RegionalNews";
import SidebarNav from "./SidebarNav";
@ -13,6 +14,7 @@ export default function BodyLayout() {
<div className="lg:w-[75%] space-y-7">
<CategorySatker />
<RegionalNews />
<PolriApps />
<MedolUpdate />
<MediaSocial />
<ENewsPolri />

View File

@ -310,7 +310,7 @@ export default function CategorySatker() {
};
return (
<div className="text-center bg-[#DD8306] rounded-none md:rounded-lg h-auto lg:h-[338px] space-y-0 py-4 md:space-y-7 flex flex-col justify-center">
<div className="text-center bg-[#DD8306] rounded-md h-auto lg:h-[338px] space-y-0 py-4 md:space-y-7 flex flex-col justify-center">
<div className="text-xl text-white w-full justify-center flex">
<p className="border-b-3 border-[#C3170F] py-2 w-fit">
{" "}

View File

@ -26,6 +26,7 @@ import { Nabla } from "next/font/google";
export default function HeaderNews() {
const [article, setArticle] = useState<any>([]);
const t = useTranslations("Landing");
const [selectedTab, setSelectedTab] = useState("media");
useEffect(() => {
async function getArticle() {
@ -243,8 +244,74 @@ export default function HeaderNews() {
<CircularProgress aria-label="Loading..." size="lg" />
)}
</div>
<div className="lg:w-[25%] rounded-md text-white dark:text-black ">
<GPRKominfo />
<div className="lg:w-[25%] h-[67vh] rounded-md text-white dark:text-black ">
{/* <GPRKominfo /> */}
<div className="text-[15px] flex flex-row gap-10">
<a
onClick={() => setSelectedTab("media")}
className={
selectedTab === "media"
? "text-black border-b-3 border-red-400 cursor-pointer py-2"
: "text-slate-300 cursor-pointer py-2"
}
>
Media Update
</a>
<a
onClick={() => setSelectedTab("video")}
className={
selectedTab === "video"
? "text-black border-b-3 border-red-400 cursor-pointer py-2"
: "text-slate-300 cursor-pointer py-2"
}
>
Video Virtual
</a>
</div>
{selectedTab === "media" ? (
<div className="lg:!h-[62vh] p-2 dark:bg-stone-800 bg-[#f0f0f0] dark:text-white text-black rounded-lg">
<ScrollShadow hideScrollBar className=" h-[54vh]">
{article?.map((list: any) => (
<div
key={list.id}
className="text-xs text-left m-2 p-2 dark:bg-[#1E1616] bg-white rounded-md"
>
<Link href={`news/detail/${list?.id}`}>
<p className="text-left font-semibold">{list?.title}</p>
</Link>
<div className="flex flex-row gap-1">
<p className="py-[2px] text-left text-xs">
{convertDateFormat(list?.createdAt)} WIB
</p>
<p className="flex items-center gap-1 text-xs">
<EyeIcon />
{list?.viewCount === null ? 0 : list?.viewCount}
</p>
</div>
</div>
))}
</ScrollShadow>
<Button
className="w-full bg-[#DD8306] text-white font-bold rounded-md focus:outline-none"
radius="none"
>
Lihat Semua
</Button>
</div>
) : (
<div className="w-full">
<iframe
width="100%"
height="410"
src="https://www.youtube.com/embed/7oRcWfl9lxE?si=G_CZfXak_AiHjGzG"
title="YouTube video player"
frameBorder="0"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
referrerPolicy="strict-origin-when-cross-origin"
allowFullScreen
></iframe>
</div>
)}
</div>
</div>
);

View File

@ -84,7 +84,7 @@ export default function MediaSocial() {
</p>
</div>
</Button>
<Button
{/* <Button
className="min-w-[60px]"
variant={selectedPlatform === "tiktok" ? "solid" : "flat"}
onClick={() => setSelectedPlatform("tiktok")}
@ -101,7 +101,7 @@ export default function MediaSocial() {
Tiktok
</p>
</div>
</Button>
</Button> */}
<Button
className="min-w-[60px]"
variant={selectedPlatform === "youtube" ? "solid" : "flat"}
@ -130,9 +130,9 @@ export default function MediaSocial() {
<div className={selectedPlatform === "facebook" ? "" : "hidden"}>
<FacebookWidget />
</div>
<div className={selectedPlatform === "tiktok" ? "" : "hidden"}>
{/* <div className={selectedPlatform === "tiktok" ? "" : "hidden"}>
<FacebookWidget />
</div>
</div> */}
<div className={selectedPlatform === "youtube" ? "" : "hidden"}>
<YoutubeWidget />
</div>

View File

@ -0,0 +1,296 @@
"use client";
import { Button } from "@nextui-org/button";
import {
Image,
Modal,
ModalBody,
ModalContent,
ModalFooter,
ModalHeader,
ModalProps,
useDisclosure,
} from "@nextui-org/react";
import { ChevronLeftWhite, ChevronRightWhite } from "../icons";
import React, { useEffect, useState } from "react";
import Link from "next/link";
import { useTranslations } from "next-intl";
export default function PolriApps() {
const { isOpen, onOpen, onOpenChange } = useDisclosure();
const [scrollBehavior, setScrollBehavior] =
React.useState<ModalProps["scrollBehavior"]>("inside");
const [modalPlacement, setModalPlacement] = React.useState<any>("auto");
const t = useTranslations("Landing");
const listApps = [
{
id: 1,
img: "/landing-polri-super-apps.png",
title: "Polri Super Apps",
path: "https://play.google.com/store/apps/details?id=superapps.polri.presisi.presisi&hl=en_US&gl=US",
},
{
id: 2,
img: "/landing-portal-humas.png",
title: "Portal Humas",
path: "https://portal.humas.polri.go.id/",
},
{
id: 3,
img: "/landing-mediahub-polri.png",
title: "Portal Humas",
path: "https://play.google.com/store/apps/details?id=com.mediahub.mediahub_mobile",
},
{
id: 4,
img: "/landing-polri-tv.png",
title: "Portal Humas",
path: "https://play.google.com/store/apps/details?id=com.polritv",
},
{
id: 5,
img: "/landing-inp.png",
title: "Portal Humas",
path: "https://inp.polri.go.id/",
},
{
id: 6,
img: "/landing-polisiku.png",
title: "Portal Humas",
path: "https://play.google.com/store/apps/details?id=id.co.qlue.polisiku&hl=id&gl=ID",
},
];
const listAppsAll = [
{
id: 1,
img: "/landing-polri-super-apps.png",
title: "Polri Super Apps",
path: "https://play.google.com/store/apps/details?id=superapps.polri.presisi.presisi&hl=en_US&gl=US",
},
{
id: 2,
img: "/landing-portal-humas.png",
title: "Portal Humas",
path: "https://portal.humas.polri.go.id/",
},
{
id: 3,
img: "/landing-mediahub-polri.png",
title: "Portal Humas",
path: "https://play.google.com/store/apps/details?id=com.mediahub.mediahub_mobile",
},
{
id: 4,
img: "/landing-polri-tv.png",
title: "Portal Humas",
path: "https://play.google.com/store/apps/details?id=com.polritv",
},
{
id: 5,
img: "/landing-inp.png",
title: "Portal Humas",
path: "https://inp.polri.go.id/",
},
{
id: 6,
img: "/landing-polisiku.png",
title: "Portal Humas",
path: "https://play.google.com/store/apps/details?id=id.co.qlue.polisiku&hl=id&gl=ID",
},
{
id: 7,
img: "/landing-e-rikkes.png",
title: "e-RIKKES",
path: "https://erikkes.id/",
},
{
id: 8,
img: "/landing-e-ppsi.png",
title: "e-PPSI",
path: "https://eppsi.id/",
},
{
id: 9,
img: "/landing-bos.png",
title: "BOS",
path: "https://bos.polri.go.id/login",
},
{
id: 10,
img: "/landing-signal.png",
title: "SIGNAL",
path: "https://play.google.com/store/apps/details?id=app.signal.id",
},
{
id: 11,
img: "/landing-skck.png",
title: "SKCK Online",
path: "https://skck.polri.go.id/",
},
{
id: 12,
img: "/landing-propam-presisi.png",
title: "Propam Presisi",
path: "https://play.google.com/store/apps/details?id=com.stk.pengaduanpropam",
},
{
id: 13,
img: "/landing-sdm-polri.png",
title: "SDM Polri",
path: "https://penerimaan.polri.go.id/",
},
{
id: 14,
img: "/landing-e-avis.png",
title: "e-AVIS",
path: "https://e-avis.korlantas.polri.go.id/",
},
{
id: 10,
img: "/landing-wbs.png",
title: "Whistle Blowing System",
path: "https://pengaduan-penerimaan.polri.go.id/",
},
{
id: 11,
img: "/landing-dumas-presisi.png",
title: "Dumas Presisi",
path: "https://dumaspresisi.polri.go.id/",
},
{
id: 12,
img: "/landing-sinar.png",
title: "Sinar",
path: "https://www.digitalkorlantas.id/sim/",
},
];
// useEffect(() => {
// function updateLimitedData() {
// if (window.matchMedia("(max-width: 767px)").matches) {
// setLimitedData(list.slice(0, 2));
// } else if (window.matchMedia("(min-width: 768px) and (max-width: 1023px)").matches) {
// setLimitedData(list.slice(0, 3));
// } else {
// setLimitedData(list.slice(0, 5));
// }
// }
// updateLimitedData();
// window.addEventListener('resize', updateLimitedData);
// return () => {
// window.removeEventListener('resize', updateLimitedData);
// };
// }, [list]);
const changeNameToSlug = (name: string) => {
const cleaned = name.replace("Polda ", "").trim().toLowerCase();
const slug = cleaned.replace(/\s+/g, "-");
return slug;
};
return (
<div className="text-center rounded-md lg:rounded-lg h-auto lg:h-[338px] flex flex-col p-6 bg-[#DD8306]">
<div className="text-xl text-white w-full justify-center flex">
<p className="border-b-3 border-[#C3170F] py-2 w-fit">
{" "}
{t("aplikasi")}
</p>
</div>
<div className="flex items-center justify-around py-10">
{/* <div>
<ChevronLeftWhite color="orange" />
</div> */}
<div className="gap-2 md:gap-4 lg:gap-6 grid grid-cols-2 md:grid-cols-3 lg:grid-cols-6">
{listApps.map((item: any, index: any) => (
<Link
href={`/news/all?polda=${changeNameToSlug(item.title)}`}
key={item.path}
target="_blank"
>
<div
key={item.id}
className="w-[157px] h-[141px] flex flex-col items-center justify-evenly"
>
<Image radius="lg" className="h-[59px]" src={item.img} />
<p className="text-xs font-bold text-white">{item.title}</p>
</div>
</Link>
))}
</div>
{/* <div>
<ChevronRightWhite color="orange" />
</div> */}
</div>
<div className="flex justify-center w-full items-center">
<Button
onPress={onOpen}
className="border-red-700 text-white w-fit"
size="sm"
variant="bordered"
>
{t("lebihBanyak")}
</Button>
</div>
<Modal
isOpen={isOpen}
onOpenChange={onOpenChange}
size="5xl"
scrollBehavior={scrollBehavior}
placement={modalPlacement}
className="bg-white text-black"
>
<ModalContent>
{(onClose) => (
<>
<ModalHeader className="flex flex-col text-black justify-center items-center min-h mb- text-3xl font-semibold">
<div className="text-xl text-black w-full justify-center flex">
<p className="border-b-3 border-[#C3170F] py-2 w-fit">
{" "}
{t("aplikasi")}
</p>
</div>
</ModalHeader>
<ModalBody className="flex flex-row flex-wrap justify-center text-center">
{listAppsAll.map((item: any, index: any) => (
<div
key={index.id}
className="w-[140px] h-[115px] flex flex-col items-center justify-center rounded-lg shadow-sm"
>
<Link
href={`/news/all?polda=${changeNameToSlug(item.title)}`}
target="_blank"
>
<div className="flex flex-col items-center ">
<Image
radius="lg"
className="h-[59px]"
src={item.img}
/>
<p className="text-xs font-bold text-black">
{item.title}
</p>
</div>
</Link>
</div>
))}
</ModalBody>
<ModalFooter>
<Button
variant="light"
onPress={onClose}
className="text-danger"
>
{t("tutup")}
</Button>
</ModalFooter>
</>
)}
</ModalContent>
</Modal>
</div>
);
}

View File

@ -25,7 +25,14 @@ export default function SidebarNav() {
return (
<>
<div className="space-y-4 px-1 lg:px-5">
<div className="text-[15px] flex flex-row gap-10">
<Image
src="/sertifikat-1.png"
width={480}
height={720}
className="shadow-md rounded-lg lg:h-[67vh]"
alt="certificate"
/>
{/* <div className="text-[15px] flex flex-row gap-10">
<a
onClick={() => setSelectedTab("media")}
className={
@ -90,7 +97,7 @@ export default function SidebarNav() {
allowFullScreen
></iframe>
</div>
)}
)} */}
{/* <p className="text-[15px] border-b-3 border-red-500 w-fit py-2">
Pelayanan Informasi Publik
</p>
@ -107,10 +114,10 @@ export default function SidebarNav() {
/>
</div> */}
{/* <div className="text-xl font-semibold underline underline-offset-4 decoration-red-600">
<div className="text-xl font-semibold underline underline-offset-4 decoration-red-600">
Publikasi
<div className="flex flex-col gap-3 pt-3">
<Image
{/* <Image
height={200}
width={400}
src="/publikasi1.png"
@ -121,7 +128,7 @@ export default function SidebarNav() {
width={400}
src="/publikasi2.png"
alt="publikasi"
/>
/> */}
<Link
href="https://humas.polri.go.id/wp-content/uploads/2023/08/LAPORAN-HASIL-KEUANGAN-SEMESTER-I-DIVISI-HUMAS-POLRI-2.pdf"
target="_blank"
@ -153,16 +160,16 @@ export default function SidebarNav() {
src="/publikasi6.png"
alt="publikasi"
/>
<Link href="https://tribratanews.polri.go.id/" target="_blank">
{/* <Link href="https://tribratanews.polri.go.id/" target="_blank">
<Image
height={200}
width={400}
src="/publikasi7.png"
alt="publikasi"
/>
</Link>
</Link> */}
</div>
</div> */}
</div>
<div className="text-xl font-semibold underline underline-offset-4 decoration-red-600">
Channel Humas Polri
<div className="flex flex-col gap-3 m-10">

View File

@ -79,53 +79,51 @@ export default function MappingUserLevel() {
let level2 = undefined;
for (let i = 0; i < parsedData.length; i++) {
if (i < 4) {
const temp = parsedData[i];
if (temp.level_number === "2") {
const request = {
aliasName: temp.slug,
group: temp.group,
isActive: true,
levelNumber: 2,
name: temp.name,
parentLevelId: level1,
provinceId: 0,
};
const res = await createUserLevel(request);
if (res?.error) {
break;
}
level2 = res?.data?.data?.id;
} else if (temp.level_number === "3") {
const request = {
aliasName: temp.slug,
group: temp.group,
isActive: true,
levelNumber: 3,
name: temp.name,
parentLevelId: level2,
provinceId: 0,
};
const res = await createUserLevel(request);
if (res?.error) {
break;
}
} else {
const request = {
aliasName: temp.slug,
group: temp.group,
isActive: true,
levelNumber: 1,
name: temp.name,
parentLevelId: 0,
provinceId: 0,
};
const res = await createUserLevel(request);
if (res?.error) {
break;
}
level1 = res?.data?.data?.id;
const temp = parsedData[i];
if (temp.level_number === "2") {
const request = {
aliasName: temp.slug,
group: temp.group,
isActive: true,
levelNumber: 2,
name: temp.name,
parentLevelId: level1,
provinceId: 0,
};
const res = await createUserLevel(request);
if (res?.error) {
break;
}
level2 = res?.data?.data?.id;
} else if (temp.level_number === "3") {
const request = {
aliasName: temp.slug,
group: temp.group,
isActive: true,
levelNumber: 3,
name: temp.name,
parentLevelId: level2,
provinceId: 0,
};
const res = await createUserLevel(request);
if (res?.error) {
break;
}
} else {
const request = {
aliasName: temp.slug,
group: temp.group,
isActive: true,
levelNumber: 1,
name: temp.name,
parentLevelId: 0,
provinceId: 0,
};
const res = await createUserLevel(request);
if (res?.error) {
break;
}
level1 = res?.data?.data?.id;
}
}
}

View File

@ -15,10 +15,27 @@ const FacebookWidget = () => {
}, []);
return (
<div
className="embedsocial-hashtag rounded-md"
data-ref="7501cb8270327e936909c6ed57298ead0c5c07d0"
></div>
// <div
// className="embedsocial-hashtag rounded-md"
// data-ref="7501cb8270327e936909c6ed57298ead0c5c07d0"
// ></div>
<iframe
name="f3d8479283c8374"
width="1080px"
height="480px"
data-testid="fb:page Facebook Social Plugin"
title="fb:page Facebook Social Plugin"
scrolling="no"
allow="encrypted-media"
src="https://web.facebook.com/v12.0/plugins/page.php?adapt_container_width=true&amp;app_id=664876294862028&amp;channel=https%3A%2F%2Fstaticxx.facebook.com%2Fx%2Fconnect%2Fxd_arbiter%2F%3Fversion%3D46%23cb%3Df23357a43cf8c%26domain%3Dhumas.polri.go.id%26is_canvas%3Dfalse%26origin%3Dhttps%253A%252F%252Fhumas.polri.go.id%252Ff29b91925fa28f%26relation%3Dparent.parent&amp;container_width=280&amp;height=2080&amp;hide_cover=true&amp;href=https%3A%2F%2Fwww.facebook.com%2FDivHumasPolri&amp;locale=id_ID&amp;sdk=joey&amp;show_facepile=false&amp;small_header=false&amp;tabs=timeline&amp;width=280"
style={{
border: "none",
visibility: "visible",
width: "100%",
height: "588px",
borderRadius: "15px",
}}
></iframe>
);
};

View File

@ -39,6 +39,7 @@
"kategoriSatker": "Satker Cateogry",
"beritaWilayah": "Regional News",
"tutup": "Close",
"topik": "Main Topic"
"topik": "Main Topic",
"aplikasi": "Polri Apps"
}
}

View File

@ -38,6 +38,7 @@
"kategoriSatker": "Kategori Satker",
"beritaWilayah": "Berita Wilayah",
"tutup": "Tutup",
"topik": "Topik Utama"
"topik": "Topik Utama",
"aplikasi": "Aplikasi Polri"
}
}

BIN
public/landing-bos.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.4 KiB

BIN
public/landing-e-avis.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

BIN
public/landing-e-ppsi.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

BIN
public/landing-e-rikkes.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

BIN
public/landing-inp.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

BIN
public/landing-polisiku.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

BIN
public/landing-polri-tv.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

BIN
public/landing-signal.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

BIN
public/landing-sinar.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

BIN
public/landing-skck.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

BIN
public/landing-wbs.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

BIN
public/sertifikat-1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 198 KiB

View File

@ -9,14 +9,14 @@ import Cookies from "js-cookie";
const token = Cookies.get("access_token");
export async function getListArticle(props: PaginationRequest) {
const { page, limit, search, startDate, endDate } = props;
const { page, limit, search, startDate, endDate, isPublish } = props;
const headers = {
"content-type": "application/json",
};
return await httpGet(
`/articles?limit=${limit}&page=${page}&title=${search}&startDate=${
startDate || ""
}&endDate=${endDate || ""}`,
`/articles?limit=${limit}&page=${page}&isPublish=${
isPublish === undefined ? "" : isPublish
}&title=${search}&startDate=${startDate || ""}&endDate=${endDate || ""}`,
headers
);
}

View File

@ -61,4 +61,5 @@ export type PaginationRequest = {
search: string;
startDate?: string;
endDate?: string;
isPublish?: boolean;
};