From 85750b397b5b74a907a4ddaa18816106eec7eef7 Mon Sep 17 00:00:00 2001 From: mhmmdafif Date: Thu, 18 Dec 2025 14:37:47 +0700 Subject: [PATCH] repair: change readers to users in detail notification --- db/notification_error.db.js | 8 ++++---- services/notification_error.service.js | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/db/notification_error.db.js b/db/notification_error.db.js index 03b85d5..2ec1500 100644 --- a/db/notification_error.db.js +++ b/db/notification_error.db.js @@ -131,14 +131,14 @@ const updateNotificationErrorDb = async (id, data) => { return getNotificationByIdDb(id); }; -const getReaderNotificationErrorDb = async (id) => { +const getUsersNotificationErrorDb = async (id) => { const queryText = ` SELECT + b.notification_error_id, a.notification_error_user_id, a.contact_phone, a.contact_name, - a.is_send, - b.message_error_issue + a.is_send FROM notification_error_user a @@ -157,6 +157,6 @@ module.exports = { getAllNotificationDb, InsertNotificationErrorDb, updateNotificationErrorDb, - getReaderNotificationErrorDb + getUsersNotificationErrorDb }; diff --git a/services/notification_error.service.js b/services/notification_error.service.js index 61554a5..7b348b8 100644 --- a/services/notification_error.service.js +++ b/services/notification_error.service.js @@ -2,7 +2,7 @@ const { getAllNotificationDb, getNotificationByIdDb, InsertNotificationErrorDb, - getReaderNotificationErrorDb, + getUsersNotificationErrorDb, updateNotificationErrorDb, } = require('../db/notification_error.db'); @@ -64,7 +64,7 @@ class NotificationService { throw new ErrorHandler(404, 'Notification not found'); } - const readerNotification = (await getReaderNotificationErrorDb(id))|| []; + const usersNotification = (await getUsersNotificationErrorDb(id))|| []; // Get error code details if error_code_id exists if (notification.error_code_id) { @@ -106,7 +106,7 @@ class NotificationService { // Get activity logs for this notification const notificationLogs = (await getNotificationErrorLogByNotificationErrorIdDb(id)) || []; - notification.reader = readerNotification; + notification.users = usersNotification; notification.activity_logs = notificationLogs;