Added Note Sharing Links
CI / build (push) Has been skipped
CI / deploy (push) Successful in 1m16s

This commit is contained in:
2026-03-18 18:22:30 -05:00
parent 620071e19e
commit 4414476816
4 changed files with 162 additions and 60 deletions
+24
View File
@@ -714,6 +714,30 @@ const mapRecordToNote = (r: any): Note => {
};
};
export const fetchNoteById = async (id: string): Promise<Note | null> => {
try {
const record = await pb.collection(NOTES_COLLECTION).getOne(id);
if (!record) return null;
return mapRecordToNote(record);
} catch (err) {
console.error("Failed to fetch note by ID:", err);
return null;
}
};
export const updateStoreWithNote = (note: Note) => {
setStore("notes", (currentNotes) => {
const index = currentNotes.findIndex(n => n.id === note.id);
if (index !== -1) {
const newNotes = [...currentNotes];
newNotes[index] = note;
return newNotes;
}
return [...currentNotes, note];
});
};
// Helper to check if a task should be visible based on ownership, shares, or rules
const shouldTaskBeVisible = (task: any, currentUserId: string): boolean => {
// Own task