From 048b7b60943b4fa5f02df651ee6d633ebfa60660 Mon Sep 17 00:00:00 2001 From: bagasbanuna Date: Fri, 23 Jan 2026 14:46:44 +0800 Subject: [PATCH] API Rgister component sender Legal Documents & Registration - public/privacy-policy.html - public/terms-of-service.html - src/app/api/auth/mobile-register/route.ts ### No Issue; --- public/privacy-policy.html | 2 +- public/terms-of-service.html | 2 +- src/app/api/auth/mobile-register/route.ts | 23 +++++++++++------------ 3 files changed, 13 insertions(+), 14 deletions(-) diff --git a/public/privacy-policy.html b/public/privacy-policy.html index d80db54d..9603f572 100644 --- a/public/privacy-policy.html +++ b/public/privacy-policy.html @@ -295,7 +295,7 @@

You have the right to request access to the personal information we collect from you, details about how we have processed it, correct inaccuracies, or delete your personal information. You may also have the right to withdraw your consent to our processing of your personal information. These rights may be limited in some circumstances by applicable law.

To make a request, please contact us at bip.baliinteraktifperkasa@gmail.com.


-

© 2025 Bali Interaktif Perkasa. All rights reserved.

+

© 2026 Bali Interaktif Perkasa. All rights reserved.

\ No newline at end of file diff --git a/public/terms-of-service.html b/public/terms-of-service.html index e28fd62b..2664ec5f 100644 --- a/public/terms-of-service.html +++ b/public/terms-of-service.html @@ -104,7 +104,7 @@

\ No newline at end of file diff --git a/src/app/api/auth/mobile-register/route.ts b/src/app/api/auth/mobile-register/route.ts index da1e8ab4..9f3b74e0 100644 --- a/src/app/api/auth/mobile-register/route.ts +++ b/src/app/api/auth/mobile-register/route.ts @@ -7,6 +7,7 @@ import { NotificationMobileBodyType, NotificationMobileTitleType, } from "../../../../../types/type-mobile-notification"; +import { sendCodeOtp } from "@/lib/code-otp-sender"; export async function POST(req: Request) { if (req.method !== "POST") { @@ -69,23 +70,21 @@ export async function POST(req: Request) { { status: 400 } ); - // const msg = `HIPMI - Kode ini bersifat RAHASIA dan JANGAN DI BAGIKAN KEPAADA SIAPAPUN, termasuk anggota ataupun pengurus HIPMI lainnya.\n\n\n> Kode OTP anda: ${codeOtp}.`; - const msg = `HIPMI%20-%20Kode%20ini%20bersifat%20RAHASIA%20dan%20JANGAN%20DI%20BAGIKAN%20KEPADA%20SIAPAPUN%2C%20termasuk%20anggota%20ataupun%20pengurus%20HIPMI%20lainnya.%20Kode%20OTP%20anda%3A%20${codeOtp}.`; - // // const encodedMsg = encodeURIComponent(msg); + const resSendCode = await sendCodeOtp({ + nomor: data.nomor, + codeOtp: codeOtp.toString(), + }); - const res = await fetch( - `https://wa.wibudev.com/code?nom=${data.nomor}&text=${msg}`, - { cache: "no-cache" } - ); - - const sendWa = await res.json(); - - if (sendWa.status !== "success") + if (resSendCode.status !== 200) return NextResponse.json( { success: false, message: "Nomor Whatsapp Tidak Aktif" }, - { status: 400 } + { status: 400 }, ); + const sendWa = await resSendCode.text(); + console.log("WA Response:", sendWa); + + // =========== START SEND NOTIFICATION =========== // const adminUsers = await prisma.user.findMany({