repair resend notif wa
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
const { default: axios } = require('axios');
|
||||
const CryptoJS = require('crypto-js');
|
||||
const https = require('https');
|
||||
// const https = require('https');
|
||||
|
||||
const httpsAgent = new https.Agent({
|
||||
rejectUnauthorized: false,
|
||||
});
|
||||
// const httpsAgent = new https.Agent({
|
||||
// rejectUnauthorized: false,
|
||||
// });
|
||||
|
||||
const generateTokenRedirect = async (userPhone, userName, id) => {
|
||||
|
||||
@@ -23,7 +23,7 @@ const shortUrltiny = async (encodedToken) => {
|
||||
|
||||
const encodedUrl = encodeURIComponent(url); // ⬅️ Encode dulu!
|
||||
|
||||
const response = await axios.get(`https://tinyurl.com/api-create.php?url=${encodedUrl}`,{ httpsAgent });
|
||||
const response = await axios.get(`https://tinyurl.com/api-create.php?url=${encodedUrl}`);
|
||||
|
||||
let shortUrl = response.data;
|
||||
if (!shortUrl.startsWith('http')) {
|
||||
@@ -44,7 +44,7 @@ const sendNotifikasi = async (phone, message) => {
|
||||
const endPointWhatsapp = process.env.ENDPOINT_WHATSAPP;
|
||||
|
||||
try {
|
||||
const response = await axios.post(endPointWhatsapp, payload, { httpsAgent });
|
||||
const response = await axios.post(endPointWhatsapp, payload);
|
||||
// console.log(response.data);
|
||||
return response?.data
|
||||
} catch (error) {
|
||||
|
||||
@@ -253,7 +253,6 @@ class NotificationService {
|
||||
}, Gagal: ${results.filter((r) => r.status === "failed").length}`
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
module.exports = NotificationService;
|
||||
|
||||
Reference in New Issue
Block a user