diff --git a/db/notification_wa.db.js b/db/notification_wa.db.js index bae36a4..c4ee3e3 100644 --- a/db/notification_wa.db.js +++ b/db/notification_wa.db.js @@ -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) { diff --git a/services/notification_error.service.js b/services/notification_error.service.js index 349abdc..49f78f9 100644 --- a/services/notification_error.service.js +++ b/services/notification_error.service.js @@ -253,7 +253,6 @@ class NotificationService { }, Gagal: ${results.filter((r) => r.status === "failed").length}` ); } - } module.exports = NotificationService;