Compare commits
2 Commits
1496b80fdf
...
bba50177e9
| Author | SHA1 | Date | |
|---|---|---|---|
| bba50177e9 | |||
| 85750b397b |
@@ -131,14 +131,14 @@ const updateNotificationErrorDb = async (id, data) => {
|
|||||||
return getNotificationByIdDb(id);
|
return getNotificationByIdDb(id);
|
||||||
};
|
};
|
||||||
|
|
||||||
const getReaderNotificationErrorDb = async (id) => {
|
const getUsersNotificationErrorDb = async (id) => {
|
||||||
const queryText = `
|
const queryText = `
|
||||||
SELECT
|
SELECT
|
||||||
|
b.notification_error_id,
|
||||||
a.notification_error_user_id,
|
a.notification_error_user_id,
|
||||||
a.contact_phone,
|
a.contact_phone,
|
||||||
a.contact_name,
|
a.contact_name,
|
||||||
a.is_send,
|
a.is_send
|
||||||
b.message_error_issue
|
|
||||||
|
|
||||||
FROM notification_error_user a
|
FROM notification_error_user a
|
||||||
|
|
||||||
@@ -157,6 +157,6 @@ module.exports = {
|
|||||||
getAllNotificationDb,
|
getAllNotificationDb,
|
||||||
InsertNotificationErrorDb,
|
InsertNotificationErrorDb,
|
||||||
updateNotificationErrorDb,
|
updateNotificationErrorDb,
|
||||||
getReaderNotificationErrorDb
|
getUsersNotificationErrorDb
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ const {
|
|||||||
getAllNotificationDb,
|
getAllNotificationDb,
|
||||||
getNotificationByIdDb,
|
getNotificationByIdDb,
|
||||||
InsertNotificationErrorDb,
|
InsertNotificationErrorDb,
|
||||||
getReaderNotificationErrorDb,
|
getUsersNotificationErrorDb,
|
||||||
updateNotificationErrorDb,
|
updateNotificationErrorDb,
|
||||||
} = require('../db/notification_error.db');
|
} = require('../db/notification_error.db');
|
||||||
|
|
||||||
@@ -64,7 +64,7 @@ class NotificationService {
|
|||||||
throw new ErrorHandler(404, 'Notification not found');
|
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
|
// Get error code details if error_code_id exists
|
||||||
if (notification.error_code_id) {
|
if (notification.error_code_id) {
|
||||||
@@ -106,7 +106,7 @@ class NotificationService {
|
|||||||
// Get activity logs for this notification
|
// Get activity logs for this notification
|
||||||
const notificationLogs = (await getNotificationErrorLogByNotificationErrorIdDb(id)) || [];
|
const notificationLogs = (await getNotificationErrorLogByNotificationErrorIdDb(id)) || [];
|
||||||
|
|
||||||
notification.reader = readerNotification;
|
notification.users = usersNotification;
|
||||||
|
|
||||||
notification.activity_logs = notificationLogs;
|
notification.activity_logs = notificationLogs;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user