add: add notification

This commit is contained in:
2025-12-09 16:04:32 +07:00
parent d063478fc2
commit fb3061e0d1
5 changed files with 69 additions and 48 deletions

View File

@@ -1,6 +1,7 @@
const {
getAllNotificationDb,
getNotificationByIdDb,
InsertNotificationErrorDb,
} = require('../db/notification_error.db');
const {
@@ -40,6 +41,18 @@ class NotificationService {
}
}
static async createNotificationError(data) {
try {
if (!data || typeof data !== 'object') data = {};
const result = await InsertNotificationErrorDb(data);
return result;
} catch (error) {
throw new ErrorHandler(error.statusCode, error.message);
}
}
// Get notification by ID
static async getNotificationById(id) {
try {