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