add: add notification
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user