Commit 570520f
committed
fix(calendar): use events.patch instead of events.update to preserve all event fields
The updateEvent method used events.update (PUT), which replaces the entire
event resource. Any field not explicitly included in the request body gets
wiped -- including summary, description, reminders, colorId, visibility,
recurrence, attachments, and conferenceData. Critically, it also rejects
non-default eventTypes (Focus Time, Out of Office, Working Location) with
Event type cannot be changed because omitting eventType is interpreted
as changing it to default.
Switch to events.patch (PATCH), which only modifies the fields present in
the request body and preserves everything else. This is the correct HTTP
semantics for partial updates and matches the methods documented intent
(patch semantics comment was already in the code).
Fixes updating Focus Time, Out of Office, and Working Location events.
Also fixes data loss when updating any event with only a subset of fields
(e.g., changing only the time without re-specifying the title).
Ref: https://developers.google.com/calendar/api/v3/reference/events/patch1 parent d84d394 commit 570520f
1 file changed
+9
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
724 | 724 | | |
725 | 725 | | |
726 | 726 | | |
727 | | - | |
| 727 | + | |
728 | 728 | | |
729 | 729 | | |
730 | 730 | | |
| |||
733 | 733 | | |
734 | 734 | | |
735 | 735 | | |
736 | | - | |
| 736 | + | |
737 | 737 | | |
738 | 738 | | |
739 | 739 | | |
740 | 740 | | |
741 | 741 | | |
742 | 742 | | |
743 | | - | |
| 743 | + | |
744 | 744 | | |
745 | 745 | | |
746 | 746 | | |
747 | 747 | | |
748 | | - | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
749 | 754 | | |
750 | 755 | | |
751 | 756 | | |
| |||
0 commit comments