Fix Job
Deskripsi: - Di beranda diganti menggunakan API - Skeleton beranda - V 1.2.25
This commit is contained in:
16
src/app/api/job/get-all/route.ts
Normal file
16
src/app/api/job/get-all/route.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import { job_getAllListPublish } from "@/app_modules/job/fun/get/get_all_publish";
|
||||
import _ from "lodash";
|
||||
import { NextResponse } from "next/server";
|
||||
|
||||
export async function GET(params: Request) {
|
||||
const { searchParams } = new URL(params.url);
|
||||
const page = searchParams.get("page");
|
||||
const search = searchParams.get("search");
|
||||
|
||||
const data = await job_getAllListPublish({
|
||||
page: _.toNumber(page),
|
||||
search: search as string,
|
||||
});
|
||||
|
||||
return NextResponse.json({ data });
|
||||
}
|
||||
@@ -1,12 +1,9 @@
|
||||
import { Job_ViewBeranda } from "@/app_modules/job";
|
||||
import { job_getAllListPublish } from "@/app_modules/job/fun/get/get_all_publish";
|
||||
|
||||
export default async function Page() {
|
||||
const listJob = await job_getAllListPublish({ page: 1 });
|
||||
|
||||
return (
|
||||
<>
|
||||
<Job_ViewBeranda listJob={listJob as any} />
|
||||
<Job_ViewBeranda />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
4
src/app/lib/api_user_router/route_api_job.ts
Normal file
4
src/app/lib/api_user_router/route_api_job.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
export const API_RouteJob = {
|
||||
get_all: ({ page, search }: { page: number; search?: string }) =>
|
||||
`/api/job/get-all?page=${page}&search=${search || ""}`,
|
||||
};
|
||||
@@ -23,4 +23,6 @@ process.on('SIGINT', async () => {
|
||||
process.exit(0);
|
||||
});
|
||||
|
||||
// console.log('==> Test prisma');
|
||||
|
||||
export default prisma;
|
||||
|
||||
Reference in New Issue
Block a user