Fix QC ( Ayu ) #28

Merged
bagasbanuna merged 3 commits from qc-mobile/10-dec-25 into staging 2025-12-10 17:38:42 +08:00
4 changed files with 242 additions and 34 deletions
Showing only changes of commit f06482a159 - Show all commits

View File

@@ -58,8 +58,6 @@ async function POST(request: Request) {
try {
const { data } = (await request.json()) as RequestBody;
console.log("body >>", data.bidang.name);
if (!data.bidang.name || !Array.isArray(data.subBidang)) {
return NextResponse.json(
{
@@ -80,7 +78,6 @@ async function POST(request: Request) {
`;
const lastId = rows[0]?.id ?? null;
const bidangId = lastId ? String(Number(lastId) + 1) : "1";
console.log("bidangId >>", bidangId);
const slugName = data.bidang.name.toLowerCase().replace(/\s+/g, "_");
@@ -97,8 +94,6 @@ async function POST(request: Request) {
where: { masterBidangBisnisId: createdBidang.id },
});
console.log("existingSubCount >>", existingSubCount);
// 3) generate unique ids satu-per-satu (cek ke DB via tx)
const subBidangToCreate: {
id: string;