repair: notification error log
This commit is contained in:
@@ -14,6 +14,7 @@ const {
|
||||
|
||||
const {
|
||||
getAllNotificationErrorLogDb,
|
||||
getNotificationErrorLogByNotificationErrorIdDb,
|
||||
} = require('../db/notification_error_log.db');
|
||||
|
||||
const { getFileUploadByPathDb } = require('../db/file_uploads.db');
|
||||
@@ -78,8 +79,7 @@ class NotificationService {
|
||||
}
|
||||
|
||||
// Get activity logs for this notification
|
||||
const activityLogs = (await getAllNotificationErrorLogDb()) || [];
|
||||
const notificationLogs = activityLogs.filter(log => log.notification_error_id === parseInt(id));
|
||||
const notificationLogs = (await getNotificationErrorLogByNotificationErrorIdDb(id)) || [];
|
||||
|
||||
notification.activity_logs = notificationLogs;
|
||||
|
||||
|
||||
@@ -59,6 +59,17 @@ class NotificationErrorLogService {
|
||||
}
|
||||
}
|
||||
|
||||
// Get Notification Error Log by notification_error_id
|
||||
static async getNotificationErrorLogByNotificationErrorId(notificationErrorId) {
|
||||
try {
|
||||
const results = await getNotificationErrorLogByNotificationErrorIdDb(notificationErrorId);
|
||||
|
||||
return results;
|
||||
} catch (error) {
|
||||
throw new ErrorHandler(error.statusCode, error.message);
|
||||
}
|
||||
}
|
||||
|
||||
// Soft delete Notification Error Log
|
||||
static async deleteNotificationErrorLog(id, userId) {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user