wisdom #48
@@ -249,8 +249,12 @@ class NotifikasiWaService {
|
||||
}
|
||||
|
||||
async loadReminder() {
|
||||
if (!fs.existsSync(filePath)) return [];
|
||||
return JSON.parse(fs.readFileSync(filePath));
|
||||
try {
|
||||
const raw = await fs.readFile(filePath, 'utf-8');
|
||||
return raw ? JSON.parse(raw) : [];
|
||||
} catch (err) {
|
||||
return []; // file belum ada
|
||||
}
|
||||
}
|
||||
|
||||
async deleteReminder(id) {
|
||||
|
||||
Reference in New Issue
Block a user