Fix API notification to report comment

Fix:
- src/app/api/mobile/admin/forum/[id]/comment/route.ts
- src/app/api/mobile/admin/forum/[id]/route.ts
- src/app/api/mobile/forum/[id]/preview-report-posting/route.ts
- src/app/api/mobile/forum/[id]/report-commentar/route.ts
- src/app/api/mobile/forum/[id]/report-posting/route.ts
- src/lib/mobile/route-page-mobile.ts
- tsconfig.json

Deleted:
- src/app/api/mobile/forum/[id]/report-comment/route.ts

Add:
- src/app/api/mobile/forum/[id]/preview-report-comment/
- src/app/api/mobile/forum/[id]/report-comment-del-soon/

### No Issue
This commit is contained in:
2026-01-19 17:38:15 +08:00
parent cb0845e264
commit 3c6dde6204
9 changed files with 147 additions and 84 deletions

View File

@@ -1,17 +1,15 @@
import { NextResponse } from "next/server";
import prisma from "@/lib/prisma";
import {
sendNotificationMobileToManyUser,
sendNotificationMobileToOneUser,
sendNotificationMobileToManyUser
} from "@/lib/mobile/notification/send-notification";
import {
routeAdminMobile
} from "@/lib/mobile/route-page-mobile";
import prisma from "@/lib/prisma";
import { NextResponse } from "next/server";
import {
NotificationMobileBodyType,
NotificationMobileTitleType,
} from "../../../../../../../types/type-mobile-notification";
import {
routeAdminMobile,
routeUserMobile,
} from "@/lib/mobile/route-page-mobile";
export { POST };
@@ -21,9 +19,6 @@ async function POST(request: Request, { params }: { params: { id: string } }) {
const { data } = await request.json();
const { authorId: reportedUserId, categoryId, description } = data;
console.log("[DATA]", data);
console.log("[ID]", id);
try {
// Postingan yang akan di report
const findPosting = await prisma.forum_Posting.findUnique({
@@ -110,40 +105,4 @@ async function POST(request: Request, { params }: { params: { id: string } }) {
reason: (error as Error).message,
});
}
}
// async function GET(request: Request, { params }: { params: { id: string } }) {
// const { id } = params;
// try {
// const report = await prisma.forum_ReportPosting.findUnique({
// where: { id: id },
// select: {
// id: true,
// ForumMaster_KategoriReport: true,
// deskripsi: true,
// Forum_Posting: {
// select: {
// id: true,
// diskusi: true,
// authorId: true,
// },
// },
// },
// });
// return NextResponse.json({
// status: 200,
// success: true,
// data: report,
// });
// } catch (error) {
// console.log("[ERROR]", error);
// return NextResponse.json({
// status: 500,
// success: false,
// message: "Gagal mendapatkan report posting",
// reason: (error as Error).message,
// });
// }
// }
}