upd: kataloh
deskripsi: - update api list portofolio No Issues
This commit is contained in:
@@ -8,9 +8,11 @@ export async function GET(request: Request) {
|
||||
let fixData
|
||||
const { searchParams } = new URL(request.url)
|
||||
const profile = searchParams.get("profile")
|
||||
const kategori_halaman = searchParams.get("cat")
|
||||
const page = searchParams.get("page")
|
||||
const dataSkip = Number(page) * 10 - 10;
|
||||
|
||||
if (page == "profile") {
|
||||
if (kategori_halaman == "profile") {
|
||||
fixData = await prisma.portofolio.findMany({
|
||||
take: 2,
|
||||
orderBy: {
|
||||
@@ -27,8 +29,10 @@ export async function GET(request: Request) {
|
||||
profileId: true,
|
||||
},
|
||||
});
|
||||
} else if (page == "portofolio") {
|
||||
} else if (kategori_halaman == "portofolio") {
|
||||
fixData = await prisma.portofolio.findMany({
|
||||
skip: dataSkip,
|
||||
take: 10,
|
||||
orderBy: {
|
||||
createdAt: "desc",
|
||||
},
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
import { Portofolio_ViewListDetail } from "@/app_modules/katalog/portofolio";
|
||||
import { portofolio_funGetAllDaftarByid } from "@/app_modules/katalog/portofolio/fun/get/get_all_portofolio";
|
||||
import { ListDetailPortofolioNew } from "@/app_modules/katalog/portofolio";
|
||||
|
||||
export default async function Page({ params }: { params: { id: string } }) {
|
||||
const profileId = params.id;
|
||||
const dataPortofolio = await portofolio_funGetAllDaftarByid({
|
||||
profileId,
|
||||
page: 1,
|
||||
});
|
||||
// const profileId = params.id;
|
||||
// const dataPortofolio = await portofolio_funGetAllDaftarByid({
|
||||
// profileId,
|
||||
// page: 1,
|
||||
// });
|
||||
|
||||
|
||||
return (
|
||||
<>
|
||||
<Portofolio_ViewListDetail dataPortofolio={dataPortofolio as any} profileId={profileId} />
|
||||
{/* <Portofolio_ViewListDetail dataPortofolio={dataPortofolio as any} profileId={profileId} /> */}
|
||||
<ListDetailPortofolioNew />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user