feat(mobile): remind me#1664
Conversation
…e description input
| toast.success('Reminder updated successfully') | ||
| router.back() | ||
| mutate("in_progress_reminders") | ||
| mutate("completed_reminders") |
There was a problem hiding this comment.
I dont think need to mutate completed_reminders on update as well as on create
| } | ||
|
|
||
| const handleDelete = () => { | ||
| Promise.all(data.message.map((reminder: Reminder) => deleteDoc('Raven Reminder', reminder.name))) |
There was a problem hiding this comment.
use bulk delete API (POST Call) frappe.desk.reportview.delete_items
| .then(() => { | ||
| toast.success('Reminder marked as complete') | ||
| mutate("in_progress_reminders") | ||
| mutate('reminders_count') |
There was a problem hiding this comment.
completed data mutate required,
Better Solution - Instead of calling each in_progress_reminder or reminder_count or completed_reminders every time, just publish the events from backend when reminders get updated (for user)
|
|
||
|
|
||
| @frappe.whitelist(methods=["POST"]) | ||
| def create_reminder(remind_at: str, message_id: str | None = None, description: str | None = None): |
There was a problem hiding this comment.
Use Create Doc instead of API and for toggle_like you can call in after_insert of Raven Reminder
|
|
||
|
|
||
| @frappe.whitelist(methods=["POST"]) | ||
| def update_reminder(reminder_id: str, remind_at: str, description: str | None = None): |
There was a problem hiding this comment.
use useFrappeUpdateDoc instead of API
|
|
||
|
|
||
| def send_reminders(): | ||
| reminders = frappe.get_all( |
| if len(reminders) == 0: | ||
| return | ||
|
|
||
| frappe.publish_realtime("due_reminders", {"message": reminders}, room="all", after_commit=True) |
There was a problem hiding this comment.
add user in publish_realtime
|
Some shortcuts will help. (In 10 minutes, in 1hr, evening, tomorrow morning etc) |
Simulator.Screen.Recording.-.iPhone.16.Pro.Max.-.2025-05-04.at.13.11.18.mp4