# Forum Report
## feat - Repot posting - Report komentar ### No issuee
This commit is contained in:
@@ -19,6 +19,7 @@ import event_status from "../../../bin/seeder/event/master_status.json";
|
||||
import event_tipe_acara from "../../../bin/seeder/event/master_tipe_acara.json";
|
||||
import voting_status from "../../../bin/seeder/voting/master_status.json";
|
||||
import master_status from "../../../bin/seeder/master_status.json";
|
||||
import forum_kategori_report from "../../../bin/seeder/forum/master_report.json";
|
||||
|
||||
export async function GET(req: Request) {
|
||||
const dev = new URL(req.url).searchParams.get("dev");
|
||||
@@ -328,6 +329,22 @@ export async function GET(req: Request) {
|
||||
});
|
||||
}
|
||||
|
||||
for (let m of forum_kategori_report) {
|
||||
await prisma.forumMaster_KategoriReport.upsert({
|
||||
where: {
|
||||
id: m.id as number,
|
||||
},
|
||||
create: {
|
||||
title: m.title,
|
||||
deskripsi: m.deskripsi,
|
||||
},
|
||||
update: {
|
||||
title: m.title,
|
||||
deskripsi: m.deskripsi,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
return NextResponse.json({ success: true });
|
||||
}
|
||||
|
||||
|
||||
@@ -2,9 +2,12 @@ import Forum_Detail from "@/app_modules/forum/detail";
|
||||
import { forum_getKomentarById } from "@/app_modules/forum/fun/get/get_komentar_by_id";
|
||||
import { forum_getOnePostingById } from "@/app_modules/forum/fun/get/get_one_posting_by_id";
|
||||
import { forum_countOneTotalKomentarById } from "@/app_modules/forum/fun/count/count_one_total_komentar_by_id";
|
||||
import { User_getUserId } from "@/app_modules/fun_global/get_user_token";
|
||||
|
||||
export default async function Page({ params }: { params: { id: string } }) {
|
||||
let postingId = params.id;
|
||||
|
||||
const userLoginId = await User_getUserId()
|
||||
const dataPosting = await forum_getOnePostingById(postingId);
|
||||
const listKomentar = await forum_getKomentarById(postingId);
|
||||
const totalKomentar = await forum_countOneTotalKomentarById(postingId)
|
||||
@@ -16,6 +19,7 @@ export default async function Page({ params }: { params: { id: string } }) {
|
||||
dataPosting={dataPosting as any}
|
||||
listKomentar={listKomentar as any}
|
||||
totalKomentar={totalKomentar}
|
||||
userLoginId={userLoginId}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
|
||||
14
src/app/dev/forum/report/komentar-lainnya/[id]/layout.tsx
Normal file
14
src/app/dev/forum/report/komentar-lainnya/[id]/layout.tsx
Normal file
@@ -0,0 +1,14 @@
|
||||
import { LayoutForum_ReportKomentar } from "@/app_modules/forum";
|
||||
import React from "react";
|
||||
|
||||
export default async function Layout({
|
||||
children,
|
||||
}: {
|
||||
children: React.ReactNode;
|
||||
}) {
|
||||
return (
|
||||
<>
|
||||
<LayoutForum_ReportKomentar>{children}</LayoutForum_ReportKomentar>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
import ComponentGlobal_V2_LoadingPage from "@/app_modules/component_global/loading_page_v2";
|
||||
|
||||
export default async function Page() {
|
||||
return (
|
||||
<>
|
||||
<ComponentGlobal_V2_LoadingPage />
|
||||
</>
|
||||
);
|
||||
}
|
||||
11
src/app/dev/forum/report/komentar-lainnya/[id]/page.tsx
Normal file
11
src/app/dev/forum/report/komentar-lainnya/[id]/page.tsx
Normal file
@@ -0,0 +1,11 @@
|
||||
import { Forum_ReportKomentarLainnya } from "@/app_modules/forum";
|
||||
|
||||
export default async function Page({ params }: { params: { id: string } }) {
|
||||
let komentarId = params.id;
|
||||
|
||||
return (
|
||||
<>
|
||||
<Forum_ReportKomentarLainnya komentarId={komentarId} />
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -1,8 +1,16 @@
|
||||
import { Forum_ReportKomentar } 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 komentarId = params.id
|
||||
return<>
|
||||
<Forum_ReportKomentar id={komentarId}/>
|
||||
export default async function Page({ params }: { params: { id: string } }) {
|
||||
let komentarId = params.id;
|
||||
const listReport = await forum_getMasterKategoriReport();
|
||||
|
||||
return (
|
||||
<>
|
||||
<Forum_ReportKomentar
|
||||
komentarId={komentarId}
|
||||
listReport={listReport as any}
|
||||
/>
|
||||
</>
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
14
src/app/dev/forum/report/posting-lainnya/[id]/layout.tsx
Normal file
14
src/app/dev/forum/report/posting-lainnya/[id]/layout.tsx
Normal file
@@ -0,0 +1,14 @@
|
||||
import { LayoutForum_ReportPosting } from "@/app_modules/forum";
|
||||
import React from "react";
|
||||
|
||||
export default async function Layout({
|
||||
children,
|
||||
}: {
|
||||
children: React.ReactNode;
|
||||
}) {
|
||||
return (
|
||||
<>
|
||||
<LayoutForum_ReportPosting>{children}</LayoutForum_ReportPosting>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
import ComponentGlobal_V2_LoadingPage from "@/app_modules/component_global/loading_page_v2";
|
||||
|
||||
export default async function Page() {
|
||||
return (
|
||||
<>
|
||||
<ComponentGlobal_V2_LoadingPage />
|
||||
</>
|
||||
);
|
||||
}
|
||||
11
src/app/dev/forum/report/posting-lainnya/[id]/page.tsx
Normal file
11
src/app/dev/forum/report/posting-lainnya/[id]/page.tsx
Normal file
@@ -0,0 +1,11 @@
|
||||
import { Forum_ReportPostingLainnya } from "@/app_modules/forum";
|
||||
|
||||
export default async function Page({ params }: { params: { id: string } }) {
|
||||
let postingIg = params.id;
|
||||
|
||||
return (
|
||||
<>
|
||||
<Forum_ReportPostingLainnya postingIg={postingIg} />
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -1,11 +1,16 @@
|
||||
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 id = params.id;
|
||||
let postingId = params.id;
|
||||
const listReport = await forum_getMasterKategoriReport();
|
||||
|
||||
return (
|
||||
<>
|
||||
<Forum_ReportPosting id={id} />
|
||||
<Forum_ReportPosting
|
||||
postingId={postingId}
|
||||
listReport={listReport as any}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -21,4 +21,6 @@ export const RouterForum = {
|
||||
//report
|
||||
report_posting: "/dev/forum/report/posting/",
|
||||
report_komentar: "/dev/forum/report/komentar/",
|
||||
report_posting_lainnya: "/dev/forum/report/posting-lainnya/",
|
||||
report_komentar_lainnya: "/dev/forum/report/komentar-lainnya/",
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user