Fix WA Otp
### NO Issue
This commit is contained in:
@@ -7,23 +7,24 @@ const sendCodeOtp = async ({
|
||||
codeOtp?: string;
|
||||
newMessage?: string;
|
||||
}) => {
|
||||
const msg = newMessage || `HIPMI - Kode ini bersifat RAHASIA dan JANGAN DI BAGIKAN KEPADA SIAPAPUN, termasuk anggota ataupun pengurus HIPMI lainnya.\n\n>> Kode OTP anda: ${codeOtp}.`;
|
||||
const enCode = encodeURIComponent(msg);
|
||||
const res = await fetch(
|
||||
`https://cld-dkr-prod-wajs-server.wibudev.com/api/wa/code?nom=${nomor}&text=${enCode}`,
|
||||
{
|
||||
cache: "no-cache",
|
||||
headers: {
|
||||
Authorization: `Bearer ${process.env.WA_SERVER_TOKEN}`,
|
||||
},
|
||||
const msg =
|
||||
newMessage ||
|
||||
`HIPMI - Kode ini bersifat RAHASIA dan JANGAN DI BAGIKAN KEPADA SIAPAPUN, termasuk anggota ataupun pengurus HIPMI lainnya.\n\n>> Kode OTP anda: ${codeOtp}.`;
|
||||
const enCode = msg;
|
||||
|
||||
const res = await fetch(`https://otp.wibudev.com/api/wa/send-text`, {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
Authorization: `Bearer ${process.env.WA_SERVER_TOKEN}`,
|
||||
},
|
||||
);
|
||||
// const res = await fetch(
|
||||
// `https://wa.wibudev.com/code?nom=${nomor}&text=HIPMI - Kode ini bersifat RAHASIA dan JANGAN DI BAGIKAN KEPADA SIAPAPUN, termasuk anggota ataupun pengurus HIPMI lainnya.
|
||||
// \n
|
||||
// >> Kode OTP anda: ${codeOtp}.
|
||||
// `,
|
||||
// );
|
||||
body: JSON.stringify({
|
||||
number: nomor,
|
||||
text: enCode,
|
||||
}),
|
||||
});
|
||||
|
||||
console.log("RES >>", res);
|
||||
|
||||
return res;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user