diff --git a/app/e-majalah-polri/daftar-majalah/page.tsx b/app/e-majalah-polri/daftar-majalah/page.tsx index 305d694..e8309b4 100644 --- a/app/e-majalah-polri/daftar-majalah/page.tsx +++ b/app/e-majalah-polri/daftar-majalah/page.tsx @@ -1,22 +1,10 @@ -"use client"; import { HumasLayout } from "@/components/layout/humas-layout"; import ListEnewsPolri from "@/components/table/tabel-emajalah-polri"; -import React, { Suspense, useEffect, useState } from "react"; export default function ListEnewsPage() { - const [hasMounted, setHasMounted] = useState(false); - - useEffect(() => { - setHasMounted(true); - }, []); - - // Render - if (!hasMounted) return null; return ( - - - + ); } diff --git a/app/page.tsx b/app/page.tsx index e887b9c..31207bb 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -16,7 +16,7 @@ export default function Home() { - + diff --git a/components/form/article/edit-article-form.tsx b/components/form/article/edit-article-form.tsx index 40741c9..c3f8135 100644 --- a/components/form/article/edit-article-form.tsx +++ b/components/form/article/edit-article-form.tsx @@ -110,6 +110,7 @@ export default function EditArticleForm(props: { isDetail: boolean }) { const params = useParams(); const id = params?.id; const username = Cookies.get("username"); + const userId = Cookies.get("uie"); const animatedComponents = makeAnimated(); const MySwal = withReactContent(Swal); const router = useRouter(); @@ -235,6 +236,44 @@ export default function EditArticleForm(props: { isDetail: boolean }) { }); }; + const doPublish = async () => { + MySwal.fire({ + title: "Publish Artikel?", + text: "", + icon: "warning", + showCancelButton: true, + cancelButtonColor: "#d33", + confirmButtonColor: "#3085d6", + confirmButtonText: "Submit", + }).then((result) => { + if (result.isConfirmed) { + publish(); + } + }); + }; + + const publish = async () => { + const response = await updateArticle(String(id), { + id: Number(id), + isPublish: true, + title: detailData?.title, + typeId: 1, + slug: detailData?.slug, + categoryIds: getValues("category") + .map((val) => val.id) + .join(","), + tags: getValues("tags").join(","), + description: htmlToString(getValues("description")), + htmlDescription: getValues("description"), + }); + + if (response?.error) { + error(response.message); + return false; + } + successSubmit("/admin/article"); + }; + const save = async (values: z.infer) => { loading(); const formData = { @@ -889,6 +928,7 @@ export default function EditArticleForm(props: { isDetail: boolean }) { )} {isDetail && + username === "admin-mabes" && (detailData?.statusId === 1 || detailData?.statusId === null) && ( + )} {/* {!isDetail && ( + + + ) : (
diff --git a/components/landing/NewsTicker.tsx b/components/landing/NewsTicker.tsx index ab93974..ad0dc6c 100644 --- a/components/landing/NewsTicker.tsx +++ b/components/landing/NewsTicker.tsx @@ -46,7 +46,7 @@ export default function NewsTicker() { }, [article]); return ( -
+
BREAKING NEWS
diff --git a/components/landing/footer-new.tsx b/components/landing/footer-new.tsx index a5bd5b6..ca1ee91 100644 --- a/components/landing/footer-new.tsx +++ b/components/landing/footer-new.tsx @@ -15,12 +15,16 @@ import { useTranslations } from "next-intl"; import { useEffect, useState } from "react"; import Image from "next/image"; -export default function FooterNew() { +export default function FooterNew(props: { margin?: boolean }) { const t2 = useTranslations("Navbar"); const t3 = useTranslations("LandingInformasiPublik"); return ( -
+
Channel Humas Polri diff --git a/components/landing/social-media.tsx b/components/landing/social-media.tsx index c5239d6..f1e3934 100644 --- a/components/landing/social-media.tsx +++ b/components/landing/social-media.tsx @@ -61,6 +61,9 @@ export default function SocialMediaNew() { selectedKey={selectedTab} onSelectionChange={setSelectedTab} > + + + @@ -70,9 +73,7 @@ export default function SocialMediaNew() { - - - + diff --git a/components/layout/humas-layout.tsx b/components/layout/humas-layout.tsx index cd425cd..c46cab3 100644 --- a/components/layout/humas-layout.tsx +++ b/components/layout/humas-layout.tsx @@ -20,14 +20,14 @@ export const HumasLayout = ({ children }: Props) => { // Render if (!hasMounted) return null; return ( -
+
- + {/* */} {children} - +
); diff --git a/components/main/detail/e-magazine-detail.tsx b/components/main/detail/e-magazine-detail.tsx index 31494c0..7725ff9 100644 --- a/components/main/detail/e-magazine-detail.tsx +++ b/components/main/detail/e-magazine-detail.tsx @@ -58,9 +58,9 @@ export default function EMagazineDetail() { } }; return ( -
-
-
+
+
+
Beranda @@ -141,13 +141,15 @@ export default function EMagazineDetail() {
- + + + ))} diff --git a/components/main/detail/list-news.tsx b/components/main/detail/list-news.tsx index d5ffa07..95858db 100644 --- a/components/main/detail/list-news.tsx +++ b/components/main/detail/list-news.tsx @@ -3,6 +3,7 @@ import { BreadcrumbItem, Breadcrumbs, Button, + Image, Input, Pagination, } from "@heroui/react"; @@ -19,7 +20,6 @@ import Link from "next/link"; import { useEffect, useRef, useState } from "react"; import { getListArticle } from "@/service/article"; import { formatMonthString, htmlToString, textEllipsis } from "@/utils/global"; -import Image from "next/image"; import { useParams, usePathname, @@ -52,8 +52,13 @@ export default function ListNews() { page: page, search: searchValue || "", limit: "9", - category: String(category), + // isPublish: pathname.includes("polda") ? false : true, isPublish: true, + sort: "desc", + categorySlug: + pathname.includes("polda") || pathname.includes("satker") + ? String(category) + : "", }; const response = await getListArticle(req); setArticle(response?.data?.data); @@ -121,9 +126,8 @@ export default function ListNews() { : news.thumbnailUrl } width={1920} - height={1080} alt="thumbnail" - className="rounded-t-md h-[27vh] w-full object-cover" + className="rounded-b-none h-[27vh] w-full object-cover" />
diff --git a/components/table/article-table.tsx b/components/table/article-table.tsx index d58f72c..5f87d3c 100644 --- a/components/table/article-table.tsx +++ b/components/table/article-table.tsx @@ -8,7 +8,7 @@ import { EyeIconMdi, SearchIcon, } from "@/components/icons"; -import { error, success, successToast } from "@/config/swal"; +import { close, error, loading, success, successToast } from "@/config/swal"; import { deleteArticle, getArticleByCategory, @@ -53,6 +53,15 @@ const columns = [ { name: "Status", uid: "isPublish" }, { name: "Aksi", uid: "actions" }, ]; +const columnsOtherRole = [ + { name: "No", uid: "no" }, + { name: "Judul", uid: "title" }, + { name: "Kategori", uid: "category" }, + { name: "Tanggal Unggah", uid: "createdAt" }, + { name: "Kreator", uid: "createdByName" }, + { name: "Status", uid: "isPublish" }, + { name: "Aksi", uid: "actions" }, +]; interface Category { id: number; @@ -68,13 +77,14 @@ type ArticleData = Article & { export default function ArticleTable() { const MySwal = withReactContent(Swal); const username = Cookies.get("username"); + const userId = Cookies.get("uie"); const [page, setPage] = useState(1); const [totalPage, setTotalPage] = useState(1); const [article, setArticle] = useState([]); const [showData, setShowData] = useState("10"); const [search, setSearch] = useState(""); - const [categories, setCategoies] = useState([]); + const [categories, setCategories] = useState([]); const [selectedCategories, setSelectedCategories] = useState([]); const [startDateValue, setStartDateValue] = useState({ startDate: null, @@ -92,27 +102,29 @@ export default function ArticleTable() { async function getCategories() { const res = await getArticleByCategory(); const data = res?.data?.data; - setCategoies(data); + setCategories(data); } async function initState() { + loading(); const req = { limit: showData, page: page, search: search, - startDate: - startDateValue.startDate === null ? "" : startDateValue.startDate, - endDate: startDateValue.endDate === null ? "" : startDateValue.endDate, - category: Array.from(selectedCategories).join(","), + // startDate: + // startDateValue.startDate === null ? "" : startDateValue.startDate, + // endDate: startDateValue.endDate === null ? "" : startDateValue.endDate, + categorySlug: Array.from(selectedCategories).join(","), sort: "desc", sortBy: "created_at", }; const res = await getListArticle(req); - getTableNumber(parseInt(showData), res.data?.data); + await getTableNumber(parseInt(showData), res.data?.data); setTotalPage(res?.data?.meta?.totalPage); + close(); } - const getTableNumber = (limit: number, data: Article[]) => { + const getTableNumber = async (limit: number, data: Article[]) => { if (data) { const startIndex = limit * (page - 1); let iterate = 0; @@ -227,11 +239,22 @@ export default function ArticleTable() { Detail - - - - Edit - + + {(username === "admin-mabes" || + Number(userId) === article.createdById) && ( + + + Edit + + )} handleDelete(article.id)} + className={ + username === "admin-mabes" || + Number(userId) === article.createdById + ? "" + : "hidden" + } > - - Delete + {(username === "admin-mabes" || + Number(userId) === article.createdById) && ( + <> + {" "} + + Delete + + )} @@ -269,7 +304,7 @@ export default function ArticleTable() { return cellValue; } }, - [article] + [article, page] ); let typingTimer: NodeJS.Timeout; @@ -285,6 +320,7 @@ export default function ArticleTable() { }; async function doneTyping() { + setPage(1); initState(); } @@ -346,7 +382,7 @@ export default function ArticleTable() { variant="bordered" labelPlacement="outside" placeholder="Kategori" - selectionMode="multiple" + selectionMode="single" selectedKeys={selectedCategories} className="w-full" items={categories} @@ -358,13 +394,13 @@ export default function ArticleTable() { key={item.props?.value} className="text-black dark:text-white text-xs" > - {item.textValue}, + {item.textValue} )); }} > {categories?.map((category: any) => ( - + {category?.title} ))} @@ -390,7 +426,9 @@ export default function ArticleTable() { "min-h-[50px] bg-transpararent text-black dark:text-white ", }} > - + {(column) => ( {column.name} )} diff --git a/components/table/suggestions/suggestions-table.tsx b/components/table/suggestions/suggestions-table.tsx index ceca897..10dcb55 100644 --- a/components/table/suggestions/suggestions-table.tsx +++ b/components/table/suggestions/suggestions-table.tsx @@ -66,6 +66,7 @@ import { getFeedbacks, getFeedbacksById, } from "@/service/feedbacks"; +import * as XLSX from "xlsx"; const columns = [ { name: "No", uid: "no" }, @@ -301,6 +302,51 @@ export default function SuggestionsTable() { ); const [typeDate, setTypeDate] = useState("monthly"); + const doExport = async () => { + const res = await getFeedbacks({ limit: showData, search: search }); + if (res?.data?.data) { + exportRecap(res?.data?.data); + } + }; + + const exportRecap = (data: any) => { + let temp: any = []; + let no = 0; + + const worksheet = XLSX.utils.json_to_sheet([]); + + data.map((list: any) => { + no += 1; + const now = [ + no, + list.commentFromName, + list.commentFromEmail, + list.message, + ]; + temp.push(now); + }); + + XLSX.utils.sheet_add_aoa( + worksheet, + [["No", "Nama", "Email", "Kritik & Saran"]], + { + origin: "A1", + } + ); + XLSX.utils.sheet_add_json(worksheet, temp, { + origin: "A2", + skipHeader: true, + }); + + worksheet["!cols"] = [{ wch: 7 }, { wch: 24 }, { wch: 24 }, { wch: 48 }]; + + const workbook = XLSX.utils.book_new(); + + XLSX.utils.book_append_sheet(workbook, worksheet, "ethic"); + + XLSX.writeFile(workbook, `Kritik Saran.xlsx`); + }; + return ( <>
@@ -399,7 +445,7 @@ export default function SuggestionsTable() {
-
diff --git a/components/table/tabel-emajalah-polri.tsx b/components/table/tabel-emajalah-polri.tsx index afc75e4..04d8354 100644 --- a/components/table/tabel-emajalah-polri.tsx +++ b/components/table/tabel-emajalah-polri.tsx @@ -102,167 +102,122 @@ export default function ListEnewsPolri() { } return ( -
-
-
-
- - Beranda - - -

E-Majalah Polri

-
-
- {/*
- E-majalah Polri -
*/} -
- setSearch(e.target.value)} - startContent={ - - } - endContent={ - - } - /> - {/* */} -
-

- Tanggal Publikasi -

- setStartDateValue(e)} - inputClassName="z-50 w-full text-sm bg-white border-1 border-gray-200 px-2 py-[6px] rounded-xl h-[40px] text-black" - /> -
-
-
-
- +
+
+ + Beranda + + +

E-Majalah Polri

+
+
+
+ setSearch(e.target.value)} + startContent={ + + } + endContent={ +
-
- setPage(page)} - /> -
-
+ Cari + + } + /> + +
+

+ Tanggal Publikasi +

+ {/* setStartDateValue(e)} + inputClassName="z-50 w-full text-sm bg-white border-1 border-gray-200 px-2 py-[6px] rounded-xl h-[40px] text-black" + /> */} +
+
+
+ + + {(column) => ( + + {column.label} + + )} + + + {(item: any) => ( + + + + {item.title} + + + + + + + + + )} + +
+
+ setPage(page)} + />
-
- -
); } diff --git a/components/ui/social-media/polri-tv.tsx b/components/ui/social-media/polri-tv.tsx index 7cf73ef..a0ee879 100644 --- a/components/ui/social-media/polri-tv.tsx +++ b/components/ui/social-media/polri-tv.tsx @@ -16,14 +16,10 @@ const PolriTvWidget = () => { }, []); return ( -
- -
+
); }; diff --git a/config/site.ts b/config/site.ts index 55f6e7a..d3822a2 100644 --- a/config/site.ts +++ b/config/site.ts @@ -143,6 +143,10 @@ export const siteConfig = { label: "UU & Peraturan", href: "https://sisdivkum.id/library/peraturan-kepolisian", }, + { + label: "E-Magazine", + href: "/e-majalah-polri/daftar-majalah", + }, ], }, // { diff --git a/service/activity-log.ts b/service/activity-log.ts index 287d862..903a240 100644 --- a/service/activity-log.ts +++ b/service/activity-log.ts @@ -1,10 +1,5 @@ import { PaginationRequest } from "@/types/globals"; -import { - httpDeleteInterceptor, - httpGet, - httpPost, - httpPut, -} from "./http-config/axios-base-service"; +import { httpGet, httpPost, httpPut } from "./http-config/axios-base-service"; export async function saveActivity(data: any, token?: string) { const headers = token diff --git a/service/advertisement.ts b/service/advertisement.ts index 21f9cb3..0669a81 100644 --- a/service/advertisement.ts +++ b/service/advertisement.ts @@ -1,9 +1,4 @@ -import { - httpDeleteInterceptor, - httpGet, - httpPost, - httpPut, -} from "./http-config/axios-base-service"; +import { httpGet, httpPost, httpPut } from "./http-config/axios-base-service"; import Cookies from "js-cookie"; const token = Cookies.get("access_token"); diff --git a/service/article.ts b/service/article.ts index deb0910..e966da4 100644 --- a/service/article.ts +++ b/service/article.ts @@ -19,6 +19,7 @@ export async function getListArticle(props: PaginationRequest) { category, sortBy, sort, + categorySlug, } = props; const headers = { "content-type": "application/json", @@ -30,7 +31,7 @@ export async function getListArticle(props: PaginationRequest) { endDate || "" }&categoryId=${category || ""}&sortBy=${sortBy || "created_at"}&sort=${ sort || "asc" - }`, + }&category=${categorySlug || ""}`, headers ); } @@ -85,7 +86,10 @@ export async function getArticleById(id: any) { } export async function deleteArticle(id: string) { - return await httpDeleteInterceptor(`articles/${id}`); + const headers = { + "content-type": "application/json", + }; + return await httpDeleteInterceptor(`articles/${id}`, headers); } export async function getArticleByCategory() { @@ -121,7 +125,10 @@ export async function uploadArticleThumbnail(id: string, data: any) { } export async function deleteArticleFiles(id: number) { - return await httpDeleteInterceptor(`article-files/${id}`); + const headers = { + "content-type": "multipart/form-data", + }; + return await httpDeleteInterceptor(`article-files/${id}`, headers); } export async function getUserLevelDataStat(startDate: string, endDate: string) { diff --git a/service/comment.ts b/service/comment.ts index 5fddfd5..7ac40ff 100644 --- a/service/comment.ts +++ b/service/comment.ts @@ -19,7 +19,10 @@ export async function getComments(data: any) { } export async function deleteComment(id: number) { - return await httpDeleteInterceptor(`/article-comments/${id}`); + const headers = { + "content-type": "application/json", + }; + return await httpDeleteInterceptor(`/article-comments/${id}`, headers); } export async function getCommentById(id: number) { diff --git a/service/feedbacks.ts b/service/feedbacks.ts index 4b81eb2..d4e541e 100644 --- a/service/feedbacks.ts +++ b/service/feedbacks.ts @@ -34,5 +34,8 @@ export async function getFeedbacksById(id: number) { return await httpGet(pathUrl, headers); } export async function deleteFeedback(id: number) { - return await httpDeleteInterceptor(`/feedbacks/${id}`); + const headers = { + "content-type": "application/json", + }; + return await httpDeleteInterceptor(`/feedbacks/${id}`, headers); } diff --git a/service/http-config/axios-base-service.ts b/service/http-config/axios-base-service.ts index 5b938c9..e798141 100644 --- a/service/http-config/axios-base-service.ts +++ b/service/http-config/axios-base-service.ts @@ -2,114 +2,113 @@ import axiosBaseInstance from "./http-base-service"; import mediahubBaseInstance from "./mediahub-base-service"; export async function httpPost(pathUrl: any, headers: any, data?: any) { - const response = await axiosBaseInstance - .post(pathUrl, data, { headers }) - .catch(function (error: any) { - console.log(error); - return error.response; - }); - console.log("Response base svc : ", response); - if (response?.status == 200 || response?.status == 201) { - return { - error: false, - message: "success", - data: response?.data, - }; - } else { - return { - error: true, - message: response?.data?.message || response?.data || null, - data: null, - }; - } + const response = await axiosBaseInstance + .post(pathUrl, data, { headers }) + .catch(function (error: any) { + console.log(error); + return error.response; + }); + console.log("Response base svc : ", response); + if (response?.status == 200 || response?.status == 201) { + return { + error: false, + message: "success", + data: response?.data, + }; + } else { + return { + error: true, + message: response?.data?.message || response?.data || null, + data: null, + }; + } } export async function httpGet(pathUrl: any, headers: any) { - const response = await axiosBaseInstance - .get(pathUrl, { headers }) - .catch(function (error: any) { - console.log(error); - return error.response; - }); - console.log("Response base svc : ", response); - if (response?.status == 200 || response?.status == 201) { - return { - error: false, - message: "success", - data: response?.data, - }; - } else { - return { - error: true, - message: response?.data?.message || response?.data || null, - data: null, - }; - } + const response = await axiosBaseInstance + .get(pathUrl, { headers }) + .catch(function (error: any) { + console.log(error); + return error.response; + }); + console.log("Response base svc : ", response); + if (response?.status == 200 || response?.status == 201) { + return { + error: false, + message: "success", + data: response?.data, + }; + } else { + return { + error: true, + message: response?.data?.message || response?.data || null, + data: null, + }; + } } export async function httpPut(pathUrl: any, headers: any, data?: any) { - const response = await axiosBaseInstance - .put(pathUrl, data, { headers }) - .catch(function (error: any) { - console.log(error); - return error.response; - }); - console.log("Response base svc : ", response); - if (response?.status == 200 || response?.status == 201) { - return { - error: false, - message: "success", - data: response?.data, - }; - } else { - return { - error: true, - message: response?.data?.message || response?.data || null, - data: null, - }; - } + const response = await axiosBaseInstance + .put(pathUrl, data, { headers }) + .catch(function (error: any) { + console.log(error); + return error.response; + }); + console.log("Response base svc : ", response); + if (response?.status == 200 || response?.status == 201) { + return { + error: false, + message: "success", + data: response?.data, + }; + } else { + return { + error: true, + message: response?.data?.message || response?.data || null, + data: null, + }; + } } -export async function httpDeleteInterceptor(pathUrl: any) { - const response = await axiosBaseInstance - .delete(pathUrl) - .catch((error) => error.response); - console.log("Response interceptor : ", response); - if (response?.status == 200 || response?.status == 201) { - return { - error: false, - message: "success", - data: response?.data, - }; - } else { - return { - error: true, - message: response?.data?.message || response?.data || null, - data: null, - }; - } +export async function httpDeleteInterceptor(pathUrl: any, headers: any) { + const response = await axiosBaseInstance + .delete(pathUrl, headers) + .catch((error) => error.response); + console.log("Response interceptor : ", response); + if (response?.status == 200 || response?.status == 201) { + return { + error: false, + message: "success", + data: response?.data, + }; + } else { + return { + error: true, + message: response?.data?.message || response?.data || null, + data: null, + }; + } } - export async function mediahubGet(pathUrl: any, headers: any) { - const response = await mediahubBaseInstance - .get(pathUrl, { headers }) - .catch(function (error: any) { - console.log(error); - return error.response; - }); - console.log("Response base svc : ", response); - if (response?.status == 200 || response?.status == 201) { - return { - error: false, - message: "success", - data: response?.data, - }; - } else { - return { - error: true, - message: response?.data?.message || response?.data || null, - data: null, - }; - } + const response = await mediahubBaseInstance + .get(pathUrl, { headers }) + .catch(function (error: any) { + console.log(error); + return error.response; + }); + console.log("Response base svc : ", response); + if (response?.status == 200 || response?.status == 201) { + return { + error: false, + message: "success", + data: response?.data, + }; + } else { + return { + error: true, + message: response?.data?.message || response?.data || null, + data: null, + }; + } } diff --git a/service/magazine.tsx b/service/magazine.tsx index 9fd2666..9c76d36 100644 --- a/service/magazine.tsx +++ b/service/magazine.tsx @@ -47,7 +47,10 @@ export async function getMagazineById(id: string) { } export async function deleteMagazine(id: string) { - return await httpDeleteInterceptor(`magazines/${id}`); + const headers = { + "content-type": "application/json", + }; + return await httpDeleteInterceptor(`magazines/${id}`, headers); } export async function uploadMagazineFile(id: string, data: any) { @@ -65,5 +68,8 @@ export async function uploadMagazineThumbnail(id: string, data: any) { } export async function deleteMagazineFiles(id: number) { - return await httpDeleteInterceptor(`magazine-files/${id}`); + const headers = { + "content-type": "multipart/form-data", + }; + return await httpDeleteInterceptor(`magazine-files/${id}`, headers); } diff --git a/service/master-categories.tsx b/service/master-categories.tsx index b73acbe..9efd3ec 100644 --- a/service/master-categories.tsx +++ b/service/master-categories.tsx @@ -33,7 +33,10 @@ export async function getCategoryById(id: number) { } export async function deleteCategory(id: number) { - return await httpDeleteInterceptor(`article-categories/${id}`); + const headers = { + "content-type": "application/json", + }; + return await httpDeleteInterceptor(`article-categories/${id}`, headers); } export async function uploadCategoryThumbnail(id: string, data: any) { diff --git a/service/master-user-role.ts b/service/master-user-role.ts index d075533..eda2837 100644 --- a/service/master-user-role.ts +++ b/service/master-user-role.ts @@ -35,5 +35,8 @@ export async function getMasterUserRoleById(id: any) { } export async function deleteMasterUserRole(id: string) { - return await httpDeleteInterceptor(`/user-roles/${id}`); + const headers = { + "content-type": "application/json", + }; + return await httpDeleteInterceptor(`/user-roles/${id}`, headers); } diff --git a/service/master-user.ts b/service/master-user.ts index 63ce107..925f7e0 100644 --- a/service/master-user.ts +++ b/service/master-user.ts @@ -39,7 +39,10 @@ export async function editMasterUsers(data: any, id: string) { } export async function deleteMasterUser(id: string) { - return await httpDeleteInterceptor(`/users/${id}`); + const headers = { + "content-type": "application/json", + }; + return await httpDeleteInterceptor(`/users/${id}`, headers); } export async function postSignIn(data: any) { @@ -132,5 +135,8 @@ export async function getArticleComment(id: string) { } export async function deleteArticleComment(id: number) { - return await httpDeleteInterceptor(`/article-comments/${id}`); + const headers = { + "content-type": "application/json", + }; + return await httpDeleteInterceptor(`/article-comments/${id}`, headers); } diff --git a/types/globals.tsx b/types/globals.tsx index 092d25f..9b5dff5 100644 --- a/types/globals.tsx +++ b/types/globals.tsx @@ -65,4 +65,5 @@ export type PaginationRequest = { category?: string; sortBy?: string; sort?: string; + categorySlug?: string; };