5531 update gmail full sync to v2 (#5674)
Closes #5531 --------- Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
@ -2,7 +2,6 @@ import { Injectable } from '@nestjs/common';
|
||||
import { OnEvent } from '@nestjs/event-emitter';
|
||||
|
||||
import { AnalyticsService } from 'src/engine/core-modules/analytics/analytics.service';
|
||||
import { CreateAnalyticsInput } from 'src/engine/core-modules/analytics/dto/create-analytics.input';
|
||||
import { ObjectRecordCreateEvent } from 'src/engine/integrations/event-emitter/types/object-record-create.event';
|
||||
|
||||
@Injectable()
|
||||
@ -11,14 +10,13 @@ export class TelemetryListener {
|
||||
|
||||
@OnEvent('*.created')
|
||||
async handleAllCreate(payload: ObjectRecordCreateEvent<any>) {
|
||||
this.analyticsService.create(
|
||||
await this.analyticsService.create(
|
||||
{
|
||||
type: 'track',
|
||||
name: payload.name,
|
||||
data: JSON.parse(`{
|
||||
"eventName": "${payload.name}"
|
||||
}`),
|
||||
} as CreateAnalyticsInput,
|
||||
data: {
|
||||
eventName: payload.name,
|
||||
},
|
||||
},
|
||||
payload.userId,
|
||||
payload.workspaceId,
|
||||
'', // voluntarely not retrieving this
|
||||
|
||||
Reference in New Issue
Block a user