File tree Expand file tree Collapse file tree 1 file changed +7
-8
lines changed
packages/backend/src/event/controllers Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,12 @@ class EventController {
2222 private async processEvents ( _events : CompassEvent [ ] ) {
2323 const events = _events . map ( ( e ) => ( {
2424 ...e ,
25- payload : CompassCoreEventSchema . parse ( e . payload ) ,
25+ payload : CompassCoreEventSchema . parse ( {
26+ ...e . payload ,
27+ _id :
28+ e . payload . _id ?. replace ( `${ ID_OPTIMISTIC_PREFIX } -` , "" ) ??
29+ new ObjectId ( ) . toString ( ) ,
30+ } ) ,
2631 } ) ) as CompassEvent [ ] ;
2732
2833 await CompassSyncProcessor . processEvents ( events ) ;
@@ -41,13 +46,7 @@ class EventController {
4146
4247 await this . processEvents (
4348 events . map ( ( e ) => ( {
44- payload : {
45- ...e ,
46- _id :
47- e . _id ?. replace ( `${ ID_OPTIMISTIC_PREFIX } ` , "" ) ??
48- new ObjectId ( ) . toString ( ) ,
49- user,
50- } ,
49+ payload : { ...e , user } ,
5150 status : CompassEventStatus . CONFIRMED ,
5251 applyTo : RecurringEventUpdateScope . THIS_EVENT ,
5352 } ) ) as CompassEvent [ ] ,
You can’t perform that action at this time.
0 commit comments