fix:detail article suggest article
This commit is contained in:
parent
45350a7132
commit
1df9197c5b
|
|
@ -259,6 +259,7 @@ export default function ListNews() {
|
||||||
usedMonth && usedYear
|
usedMonth && usedYear
|
||||||
? convertDateFormatNoTimeV2(new Date(usedYear, usedMonth, 0))
|
? convertDateFormatNoTimeV2(new Date(usedYear, usedMonth, 0))
|
||||||
: "",
|
: "",
|
||||||
|
timeStamp: getUnixTimestamp(),
|
||||||
};
|
};
|
||||||
|
|
||||||
const response = await getListArticle(req);
|
const response = await getListArticle(req);
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,11 @@ import "swiper/css/pagination";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import { getListArticle } from "@/services/article";
|
import { getListArticle } from "@/services/article";
|
||||||
import { Card, CardFooter, Skeleton } from "@heroui/react";
|
import { Card, CardFooter, Skeleton } from "@heroui/react";
|
||||||
import { convertDateFormat, textEllipsis } from "@/utils/global";
|
import {
|
||||||
|
convertDateFormat,
|
||||||
|
getUnixTimestamp,
|
||||||
|
textEllipsis,
|
||||||
|
} from "@/utils/global";
|
||||||
import Image from "next/image";
|
import Image from "next/image";
|
||||||
|
|
||||||
export default function SidebarDetail() {
|
export default function SidebarDetail() {
|
||||||
|
|
@ -27,7 +31,9 @@ export default function SidebarDetail() {
|
||||||
search: "",
|
search: "",
|
||||||
limit: "10",
|
limit: "10",
|
||||||
isPublish: true,
|
isPublish: true,
|
||||||
category: "781,802",
|
sort: "desc",
|
||||||
|
categoryIds: "791,802",
|
||||||
|
timeStamp: getUnixTimestamp(),
|
||||||
};
|
};
|
||||||
|
|
||||||
const response = await getListArticle(req);
|
const response = await getListArticle(req);
|
||||||
|
|
@ -35,12 +41,14 @@ export default function SidebarDetail() {
|
||||||
}
|
}
|
||||||
|
|
||||||
async function getArticlePolda() {
|
async function getArticlePolda() {
|
||||||
|
console.log("jalan");
|
||||||
const req = {
|
const req = {
|
||||||
page: 1,
|
page: 1,
|
||||||
search: "",
|
search: "",
|
||||||
limit: "10",
|
limit: "10",
|
||||||
|
sort: "desc",
|
||||||
isPublish: true,
|
isPublish: true,
|
||||||
isPolda: true,
|
timeStamp: getUnixTimestamp(),
|
||||||
};
|
};
|
||||||
|
|
||||||
const response = await getListArticle(req);
|
const response = await getListArticle(req);
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,7 @@ export async function getListArticle(props: PaginationRequest) {
|
||||||
categoryIds,
|
categoryIds,
|
||||||
createdByIds,
|
createdByIds,
|
||||||
isPolda,
|
isPolda,
|
||||||
|
timeStamp,
|
||||||
} = props;
|
} = props;
|
||||||
const headers = {
|
const headers = {
|
||||||
"content-type": "application/json",
|
"content-type": "application/json",
|
||||||
|
|
@ -37,7 +38,7 @@ export async function getListArticle(props: PaginationRequest) {
|
||||||
sort || "desc"
|
sort || "desc"
|
||||||
}&category=${categorySlug || ""}&isBanner=${isBanner || ""}&categoryIds=${
|
}&category=${categorySlug || ""}&isBanner=${isBanner || ""}&categoryIds=${
|
||||||
categoryIds || ""
|
categoryIds || ""
|
||||||
}&createdByIds=${createdByIds || ""}&isPolda=${isPolda || ""}`,
|
}&createdByIds=${createdByIds || ""}&isPolda=${isPolda || ""}&timeStamp=${timeStamp || ""}`,
|
||||||
headers,
|
headers,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue