Compare commits

...

3 Commits

Author SHA1 Message Date
436ea1cf89 replace created at in notif error 2026-01-09 14:30:07 +07:00
8e0dc4bb88 fixing token redirect 2026-01-09 11:06:05 +07:00
b680a249d5 connect mqtt ws colo 2026-01-08 15:07:47 +07:00
4 changed files with 12 additions and 7 deletions

View File

@@ -292,11 +292,11 @@ const mqttOptions = {
clientId: 'express_mqtt_client_' + Math.random().toString(16).substr(2, 8),
clean: true,
connectTimeout: 4000,
username: '', // jika ada
password: '', // jika ada
username: 'morekmorekmorek', // jika ada
password: 'morek888', // jika ada
};
const mqttUrl = 'ws://localhost:1884'; // Ganti dengan broker kamu
const mqttUrl = 'ws://117.102.231.130:7001'; // Ganti dengan broker kamu
const topic = process.env.TOPIC_COD ?? 'morek';
const mqttClient = mqtt.connect(mqttUrl, mqttOptions);

View File

@@ -104,6 +104,8 @@ class AuthController {
const bytes = CryptoJS.AES.decrypt(tokenRedirect, process.env.VITE_KEY_SESSION);
const decrypted = JSON.parse(bytes.toString(CryptoJS.enc.Utf8));
console.log("decrypted: ", decrypted);
const userPhone = decrypted?.user_phone
const userName = decrypted?.user_name
const idData = decrypted?.id

View File

@@ -95,7 +95,8 @@ const getAllNotificationDb = async (searchParams = {}) => {
],
queryParams
);
if (whereParamAnd) queryParams = whereParamAnd;
queryParams = whereParamAnd ? whereParamAnd : queryParams;
const queryText = `
SELECT
@@ -108,12 +109,12 @@ const getAllNotificationDb = async (searchParams = {}) => {
a.is_delivered,
a.is_read,
a.is_active,
a.created_at,
b.error_code,
b.error_code_name,
b.error_code_color,
b.path_icon,
b.created_at,
c.solution_name,
c.type_solution,

View File

@@ -67,8 +67,8 @@ class NotifikasiWaService {
for (const dataUser of dataUsers) {
if (dataUser.is_active) {
const tokenRedirect = await generateTokenRedirect(
dataUser.userPhone,
dataUser.userName,
dataUser.contact_phone,
dataUser.contact_name,
resultNotificationError.notification_error_id
);
@@ -105,6 +105,8 @@ class NotifikasiWaService {
param.bodyMessage
);
console.log("resultSend: ", resultSend);
await updateNotificationErrorUserDb(
resultNotificationErrorUser[0].notification_error_user_id,
{