MCPcopy Create free account
hub / github.com/GlobalTechInfo/MEGA-MD / getUserNotes

Function getUserNotes

plugins/notes.js:8–16  ·  view source on GitHub ↗
(userId)

Source from the content-addressed store, hash-verified

6const HAS_DB = !!(MONGO_URL || POSTGRES_URL || MYSQL_URL || SQLITE_URL);
7const notesDB = {};
8async 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}
17async function saveUserNotes(userId, notes) {
18 if (HAS_DB) {
19 await store.saveSetting(userId, 'notes', notes);

Callers 1

handlerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected