Files
hipmi/src/app/api/auth/term-service/route.ts
bagasbanuna 09be7739d5 Fix rejected Apple:
Penambahan fitur checklist terms of service dan penambahan database blockuser

Add:
- prisma/migrations/20251124061947_add_terms_of_service_accepted/
- prisma/migrations/20251124081155_add_blocked_user_and_menu_feature/
- prisma/migrations/20251124083155_fix_master_kategori_app_and_delete_menu_feature/
- public/terms-of-service.html
- src/app/api/auth/term-service/

Fix:
- prisma/schema.prisma
- src/app/api/auth/register/route.ts
- src/app/api/auth/validasi/route.ts
- src/app_modules/_global/fun/generate_seeder.ts
- src/bin/seeder/master/master_kategori_app.json
- src/bin/seeder/user_seeder.json
- src/middleware.tsx

### No Issue
2025-11-24 16:44:00 +08:00

30 lines
634 B
TypeScript

import { NextResponse } from "next/server";
import prisma from "@/lib/prisma";
export async function POST(req: Request) {
try {
const { data } = await req.json();
console.log("data >>", data);
const updateTermService = await prisma.user.update({
where: {
id: data.id,
},
data: {
termsOfServiceAccepted: data.termsOfServiceAccepted,
},
});
return NextResponse.json({
success: true,
message: "Berhasil",
});
} catch (error) {
console.log("error >>", error);
return NextResponse.json({
success: false,
message: "Gagal",
});
}
}