deskripsi:
- fix api job : detail > publish, review, reject, draft, arsip
This commit is contained in:
2025-02-20 12:02:11 +08:00
parent 57d04450e1
commit f55d4c601f
23 changed files with 568 additions and 288 deletions

View File

@@ -1,9 +1,52 @@
import backendLogger from "@/util/backendLogger";
import { NextResponse } from "next/server";
export { GET };
async function GET(request: Request) {
return NextResponse.json({
success: true,
});
async function GET(request: Request, { params }: { params: { id: string } }) {
try {
const { id } = params;
const data = await prisma.job.findUnique({
where: {
id: id,
},
include: {
Author: {
select: {
username: true,
nomor: true,
Profile: {
select: {
name: true,
alamat: true,
},
},
},
},
MasterStatus: {
select: {
name: true,
},
},
},
});
return NextResponse.json(
{
success: true,
message: "Success get data job-vacancy",
data: data,
},
{ status: 200 }
);
} catch (error) {
backendLogger.error("Error get data job-vacancy", error);
return NextResponse.json(
{
success: false,
message: "Error get data job-vacancy",
reason: (error as Error).message,
},
{ status: 500 }
);
}
}

View File

@@ -1,12 +1,9 @@
import { Job_DetailArsip } from "@/app_modules/job";
import { job_getOneById } from "@/app_modules/job/fun/get/get_one_by_id";
import { Job_DetailArsip } from "@/app_modules/job";
export default async function Page({params}:{params: {id: string}}) {
let jobId = params.id
const dataJob = await job_getOneById(jobId)
export default async function Page() {
return (
<>
<Job_DetailArsip dataJob={dataJob as any} />
<Job_DetailArsip />
</>
);
}

View File

@@ -1,14 +1,11 @@
import Job_DetailDraft from "@/app_modules/job/detail/draft/view";
import { job_getOneById } from "@/app_modules/job/fun/get/get_one_by_id";
export default async function Page({params}: {params: {id: string}}) {
let jobId = params.id
const dataJob = await job_getOneById(jobId)
export default async function Page() {
return (
<>
<Job_DetailDraft dataJob={dataJob as any} jobId={jobId} />
<Job_DetailDraft />
</>
);
}

View File

@@ -1,13 +1,10 @@
import { Job_MainDetail } from "@/app_modules/job";
import { job_getOneById } from "@/app_modules/job/fun/get/get_one_by_id";
export default async function Page({ params }: { params: { id: string } }) {
const idJob = params.id;
const dataJob = await job_getOneById(idJob);
export default async function Page() {
return (
<>
<Job_MainDetail dataJob={dataJob as any} />
<Job_MainDetail />
</>
);
}

View File

@@ -1,13 +1,9 @@
import { Job_DetailPublish } from "@/app_modules/job";
import { job_getOneById } from "@/app_modules/job/fun/get/get_one_by_id";
export default async function Page({params}: {params: {id: string}}) {
let jobId = params.id
const dataJob = await job_getOneById(jobId)
export default async function Page() {
return (
<>
<Job_DetailPublish dataJob={dataJob as any} />
<Job_DetailPublish />
</>
);
}

View File

@@ -1,14 +1,11 @@
import Job_DetailReject from "@/app_modules/job/detail/reject/view";
import { job_getOneById } from "@/app_modules/job/fun/get/get_one_by_id";
export default async function Page({params}: {params: {id: string}}) {
let jobId = params.id
const dataJob = await job_getOneById(jobId)
export default async function Page() {
return (
<>
<Job_DetailReject dataJob={dataJob as any} />
<Job_DetailReject />
</>
);
}

View File

@@ -1,18 +1,9 @@
import Job_DetailReview from "@/app_modules/job/detail/review/view";
import { job_getOneById } from "@/app_modules/job/fun/get/get_one_by_id";
import React from "react";
export default async function Page({
params,
}: {
params: { id: React.ReactNode };
}) {
let jobId = params.id;
const dataJob = await job_getOneById(jobId)
export default async function Page() {
return (
<>
<Job_DetailReview dataJob={dataJob as any} />
<Job_DetailReview />
</>
);
}

View File

@@ -1,13 +1,11 @@
import { Job_Edit } from "@/app_modules/job";
import { job_getOneById } from "@/app_modules/job/fun/get/get_one_by_id";
export default async function Page({ params }: { params: { id: string } }) {
let jobId = params.id;
const dataJob = await job_getOneById(jobId);
export default async function Page() {
return (
<>
<Job_Edit dataJob={dataJob as any} />
<Job_Edit />
</>
);
}

View File

@@ -16,7 +16,15 @@ export default function Voting_ComponentSkeletonViewPuh() {
header={<UIGlobal_LayoutHeaderTamplate title="Skeleton Maker" />}
>
<Stack>
<Grid align="center">
<CustomSkeleton height={300} width={"100%"} />
<Center>
<CustomSkeleton height={40} radius={"xl"} width={"50%"} />
</Center>
<CustomSkeleton height={500} width={"100%"} />
<CustomSkeleton height={40} radius={"xl"} width={"100%"} />
</Stack>
{/* <Grid align="center">
<Grid.Col span={2}>
<CustomSkeleton height={40} width={40} circle />
</Grid.Col>
@@ -33,8 +41,7 @@ export default function Voting_ComponentSkeletonViewPuh() {
<Stack>
<CustomSkeleton height={20} width={"100%"} radius={"xl"} />
<CustomSkeleton height={20} width={"100%"} radius={"xl"} />
</Stack>
</Stack>
</Stack> */}
{/* <Stack spacing={"xl"} p={"sm"}>
{Array.from({ length: 4 }).map((_, i) => (