refactor: update notification service to use deleteReminder from notifikasiWaService and improve data filtering logic

This commit is contained in:
2026-04-30 13:08:27 +07:00
parent 3428ad6d1f
commit 7940646a1f
2 changed files with 6 additions and 5 deletions

View File

@@ -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" };