refactor: update notification service to use deleteReminder from notifikasiWaService and improve data filtering logic
This commit is contained in:
@@ -31,9 +31,10 @@ const {
|
||||
} = require("../db/notification_wa.db");
|
||||
|
||||
const { ErrorHandler } = require("../helpers/error");
|
||||
const { deleteReminder } = require("./notifikasi-wa.service");
|
||||
const { getSparepartsByYearlyDb } = require("../db/sparepart.db");
|
||||
|
||||
const notifikasiWaService = require("./notifikasi-wa.service");
|
||||
|
||||
class NotificationService {
|
||||
static async getAllNotification(param) {
|
||||
try {
|
||||
@@ -162,7 +163,7 @@ class NotificationService {
|
||||
|
||||
const notification = Array.isArray(dataExist) ? dataExist[0] : dataExist;
|
||||
|
||||
await deleteReminder(notification_error_id)
|
||||
await notifikasiWaService.deleteReminder(notification_error_id)
|
||||
|
||||
if (notification.is_read === true) {
|
||||
return { success: true, message: "Notification has already been read" };
|
||||
|
||||
Reference in New Issue
Block a user