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

@@ -258,9 +258,9 @@ class NotifikasiWaService {
}
async deleteReminder(id) {
let data = this.loadReminder();
let data = await this.loadReminder();
const newData = data.filter(item => item.notification_log !== id);
const newData = data?.filter(item => item.notification_log !== id);
// cek apakah ada yang terhapus
if (data.length === newData.length) {
@@ -283,7 +283,7 @@ class NotifikasiWaService {
const now = new Date();
let data = this.loadReminder();
data = data.filter(async (item) => {
data = data?.filter(async (item) => {
// ❌ jika non aktif → hapus
if (!item.active) return false;