From 8777c45a443173e69c689643c735b4c513e25d72 Mon Sep 17 00:00:00 2001 From: nico Date: Wed, 1 Apr 2026 17:44:48 +0800 Subject: [PATCH] fix(build): resolve ESLint and type errors causing build failure --- src/app/api/auth/login/route.ts | 6 +++--- src/app/api/auth/register/route.ts | 5 +++-- src/app/api/auth/resend/route.ts | 5 +++-- src/app/api/auth/send-otp-register/route.ts | 5 +++-- .../darmasaba/_com/main-page/apbdes/lib/grafikRealisasi.tsx | 4 ++-- src/app/darmasaba/_com/main-page/apbdes/lib/paguTable.tsx | 1 - .../darmasaba/_com/main-page/apbdes/lib/realisasiTable.tsx | 1 - 7 files changed, 14 insertions(+), 13 deletions(-) diff --git a/src/app/api/auth/login/route.ts b/src/app/api/auth/login/route.ts index 1b9baccf..87d7deb4 100644 --- a/src/app/api/auth/login/route.ts +++ b/src/app/api/auth/login/route.ts @@ -43,7 +43,6 @@ export async function POST(req: Request) { try { const res = await fetch(waUrl); if (!res.ok) { - const errorText = await res.text(); console.error(`⚠️ WA Service HTTP Error: ${res.status} ${res.statusText}. Continuing since OTP is logged.`); console.log(`💡 Use this OTP to login: ${codeOtp}`); } else { @@ -53,8 +52,9 @@ export async function POST(req: Request) { console.error("⚠️ WA Service Logic Error:", sendWa); } } - } catch (waError: any) { - console.error("⚠️ WA Connection Exception. Continuing since OTP is logged.", waError.message); + } catch (waError: unknown) { + const errorMessage = waError instanceof Error ? waError.message : String(waError); + console.error("⚠️ WA Connection Exception. Continuing since OTP is logged.", errorMessage); } const createOtpId = await prisma.kodeOtp.create({ diff --git a/src/app/api/auth/register/route.ts b/src/app/api/auth/register/route.ts index 83ec5bb6..122e3f1a 100644 --- a/src/app/api/auth/register/route.ts +++ b/src/app/api/auth/register/route.ts @@ -35,8 +35,9 @@ export async function POST(req: Request) { const waData = await waRes.json(); console.log("📱 WA Response (Register):", waData); } - } catch (waError: any) { - console.warn("⚠️ WA Connection Exception (Register). Continuing since OTP is logged.", waError.message); + } catch (waError: unknown) { + const errorMessage = waError instanceof Error ? waError.message : String(waError); + console.warn("⚠️ WA Connection Exception (Register). Continuing since OTP is logged.", errorMessage); } // ✅ Simpan OTP ke database diff --git a/src/app/api/auth/resend/route.ts b/src/app/api/auth/resend/route.ts index 5d06728c..b19ee66f 100644 --- a/src/app/api/auth/resend/route.ts +++ b/src/app/api/auth/resend/route.ts @@ -31,8 +31,9 @@ export async function POST(req: Request) { const waData = await waRes.json(); console.log("📱 WA Response (Resend):", waData); } - } catch (waError: any) { - console.warn("⚠️ WA Connection Exception (Resend). Continuing since OTP is logged.", waError.message); + } catch (waError: unknown) { + const errorMessage = waError instanceof Error ? waError.message : String(waError); + console.warn("⚠️ WA Connection Exception (Resend). Continuing since OTP is logged.", errorMessage); } // Simpan OTP ke database diff --git a/src/app/api/auth/send-otp-register/route.ts b/src/app/api/auth/send-otp-register/route.ts index d944b15e..e578349f 100644 --- a/src/app/api/auth/send-otp-register/route.ts +++ b/src/app/api/auth/send-otp-register/route.ts @@ -34,8 +34,9 @@ export async function POST(req: Request) { const sendWa = await res.json(); console.log("📱 WA Response (SendOTPRegister):", sendWa); } - } catch (waError: any) { - console.warn("⚠️ WA Connection Exception (SendOTPRegister). Continuing since OTP is logged.", waError.message); + } catch (waError: unknown) { + const errorMessage = waError instanceof Error ? waError.message : String(waError); + console.warn("⚠️ WA Connection Exception (SendOTPRegister). Continuing since OTP is logged.", errorMessage); } // Simpan OTP diff --git a/src/app/darmasaba/_com/main-page/apbdes/lib/grafikRealisasi.tsx b/src/app/darmasaba/_com/main-page/apbdes/lib/grafikRealisasi.tsx index 07bdb183..f1c97dde 100644 --- a/src/app/darmasaba/_com/main-page/apbdes/lib/grafikRealisasi.tsx +++ b/src/app/darmasaba/_com/main-page/apbdes/lib/grafikRealisasi.tsx @@ -1,7 +1,7 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ -import { Paper, Title, Progress, Stack, Text, Group, Box, rem } from '@mantine/core' +import { Paper, Title, Progress, Stack, Text, Group, Box } from '@mantine/core' import { IconArrowUpRight, IconArrowDownRight } from '@tabler/icons-react' -import { APBDes, APBDesItem, SummaryData } from '../types/apbdes' +import { APBDes, APBDesItem } from '../types/apbdes' interface SummaryProps { title: string diff --git a/src/app/darmasaba/_com/main-page/apbdes/lib/paguTable.tsx b/src/app/darmasaba/_com/main-page/apbdes/lib/paguTable.tsx index 04794c4c..2bb8343d 100644 --- a/src/app/darmasaba/_com/main-page/apbdes/lib/paguTable.tsx +++ b/src/app/darmasaba/_com/main-page/apbdes/lib/paguTable.tsx @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/no-explicit-any */ import { Paper, Table, Title, Box, ScrollArea, Badge } from '@mantine/core' import { APBDes, APBDesItem } from '../types/apbdes' diff --git a/src/app/darmasaba/_com/main-page/apbdes/lib/realisasiTable.tsx b/src/app/darmasaba/_com/main-page/apbdes/lib/realisasiTable.tsx index 7aea80f5..334db64f 100644 --- a/src/app/darmasaba/_com/main-page/apbdes/lib/realisasiTable.tsx +++ b/src/app/darmasaba/_com/main-page/apbdes/lib/realisasiTable.tsx @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/no-explicit-any */ import { Paper, Table, Title, Badge, Text, Box, ScrollArea } from '@mantine/core' import { APBDes, APBDesItem, RealisasiItem } from '../types/apbdes'