(userId)
| 6 | const HAS_DB = !!(MONGO_URL || POSTGRES_URL || MYSQL_URL || SQLITE_URL); |
| 7 | const notesDB = {}; |
| 8 | async function getUserNotes(userId) { |
| 9 | if (HAS_DB) { |
| 10 | const notes = await store.getSetting(userId, 'notes'); |
| 11 | return notes || []; |
| 12 | } |
| 13 | else { |
| 14 | return notesDB[userId] || []; |
| 15 | } |
| 16 | } |
| 17 | async function saveUserNotes(userId, notes) { |
| 18 | if (HAS_DB) { |
| 19 | await store.saveSetting(userId, 'notes', notes); |