feat: reminder button in list/tabs view, notifications show reminders, trash count live update
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 43s
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 43s
- Add reminder action to NoteActions (masonry view) and NoteMetaSidebar (tabs view) - NotificationPanel now fetches and displays upcoming/overdue reminders alongside share requests - Badge count includes overdue reminders; overdue items show mark-as-done toggle - Sidebar trash count refreshes on NoteRefreshContext trigger (no more manual refresh) - Add "Clear completed" button on reminders page with clearCompletedReminders action - Add i18n keys for new features (en/fr) Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -319,6 +319,31 @@ export async function toggleReminderDone(noteId: string, done: boolean) {
|
||||
}
|
||||
}
|
||||
|
||||
// Clear completed reminders (set reminder to null for done reminders)
|
||||
export async function clearCompletedReminders() {
|
||||
const session = await auth();
|
||||
if (!session?.user?.id) return { error: 'Unauthorized' }
|
||||
|
||||
try {
|
||||
await prisma.note.updateMany({
|
||||
where: {
|
||||
userId: session.user.id,
|
||||
isReminderDone: true,
|
||||
reminder: { not: null },
|
||||
},
|
||||
data: {
|
||||
reminder: null,
|
||||
isReminderDone: false,
|
||||
},
|
||||
})
|
||||
revalidatePath('/reminders')
|
||||
return { success: true }
|
||||
} catch (error) {
|
||||
console.error('Error clearing completed reminders:', error)
|
||||
return { error: 'Failed to clear reminders' }
|
||||
}
|
||||
}
|
||||
|
||||
// Get archived notes only
|
||||
export async function getArchivedNotes() {
|
||||
const session = await auth();
|
||||
|
||||
Reference in New Issue
Block a user