fix forum

deskripsi:
- fix create report posting
This commit is contained in:
2025-02-19 11:58:53 +08:00
parent 0d230c3c47
commit 15792bb430
10 changed files with 226 additions and 100 deletions

View File

@@ -0,0 +1,32 @@
import { NextResponse } from "next/server";
import prisma from "@/lib/prisma";
import backendLogger from "@/util/backendLogger";
export async function GET(request: Request) {
try {
const data = await prisma.forumMaster_KategoriReport.findMany({
orderBy: {
createdAt: "asc",
},
where: {
isActive: true,
},
});
return NextResponse.json({
success: true,
message: "Berhasil mendapatkan data",
data: data,
});
} catch (error) {
backendLogger.error("Error Get Master Kategori Report >>", error);
return NextResponse.json(
{
success: false,
message: "Gagal mendapatkan data",
reason: (error as Error).message,
},
{ status: 500 }
);
}
}

View File

@@ -1,16 +1,12 @@
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
import { Forum_ReportPostingLainnya } from "@/app_modules/forum";
export default async function Page({ params }: { params: { id: string } }) {
let postingId = params.id;
export default async function Page() {
const userLoginId = await funGetUserIdByToken();
return (
<>
<Forum_ReportPostingLainnya
postingId={postingId}
userLoginId={userLoginId as string}
/>
<Forum_ReportPostingLainnya userLoginId={userLoginId as string} />
</>
);
}

View File

@@ -1,18 +1,13 @@
import { funGetUserIdByToken } from "@/app_modules/_global/fun/get";
import { Forum_ReportPosting } from "@/app_modules/forum";
import { forum_getMasterKategoriReport } from "@/app_modules/forum/fun/master/get_master_kategori_report";
export default async function Page({ params }: { params: { id: string } }) {
let postingId = params.id;
export default async function Page() {
const userLoginId = await funGetUserIdByToken();
const listReport = await forum_getMasterKategoriReport();
return (
<>
<Forum_ReportPosting
postingId={postingId}
listReport={listReport as any}
userLoginId={userLoginId as string}
/>
</>