6071 return only updated fields of records in zapier update trigger (#8193)
- move webhook triggers into `entity-events-to-db.listener.ts` - refactor event management - add a `@OnDatabaseEvent` decorator to manage database events - add updatedFields in updated events - update openApi webhooks docs - update zapier integration
This commit is contained in:
@ -1,5 +1,4 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { OnEvent } from '@nestjs/event-emitter';
|
||||
|
||||
import { ObjectRecordCreateEvent } from 'src/engine/core-modules/event-emitter/types/object-record-create.event';
|
||||
import { ObjectRecordUpdateEvent } from 'src/engine/core-modules/event-emitter/types/object-record-update.event';
|
||||
@ -17,6 +16,8 @@ import {
|
||||
CalendarEventParticipantUnmatchParticipantJobData,
|
||||
} from 'src/modules/calendar/calendar-event-participant-manager/jobs/calendar-event-participant-unmatch-participant.job';
|
||||
import { PersonWorkspaceEntity } from 'src/modules/person/standard-objects/person.workspace-entity';
|
||||
import { OnDatabaseEvent } from 'src/engine/api/graphql/graphql-query-runner/decorators/on-database-event.decorator';
|
||||
import { DatabaseEventAction } from 'src/engine/api/graphql/graphql-query-runner/enums/database-event-action';
|
||||
|
||||
@Injectable()
|
||||
export class CalendarEventParticipantPersonListener {
|
||||
@ -25,7 +26,7 @@ export class CalendarEventParticipantPersonListener {
|
||||
private readonly messageQueueService: MessageQueueService,
|
||||
) {}
|
||||
|
||||
@OnEvent('person.created')
|
||||
@OnDatabaseEvent('person', DatabaseEventAction.CREATED)
|
||||
async handleCreatedEvent(
|
||||
payload: WorkspaceEventBatch<
|
||||
ObjectRecordCreateEvent<PersonWorkspaceEntity>
|
||||
@ -48,7 +49,7 @@ export class CalendarEventParticipantPersonListener {
|
||||
}
|
||||
}
|
||||
|
||||
@OnEvent('person.updated')
|
||||
@OnDatabaseEvent('person', DatabaseEventAction.UPDATED)
|
||||
async handleUpdatedEvent(
|
||||
payload: WorkspaceEventBatch<
|
||||
ObjectRecordUpdateEvent<PersonWorkspaceEntity>
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { OnEvent } from '@nestjs/event-emitter';
|
||||
|
||||
import { ObjectRecordCreateEvent } from 'src/engine/core-modules/event-emitter/types/object-record-create.event';
|
||||
import { ObjectRecordUpdateEvent } from 'src/engine/core-modules/event-emitter/types/object-record-update.event';
|
||||
@ -17,6 +16,8 @@ import {
|
||||
CalendarEventParticipantUnmatchParticipantJobData,
|
||||
} from 'src/modules/calendar/calendar-event-participant-manager/jobs/calendar-event-participant-unmatch-participant.job';
|
||||
import { WorkspaceMemberWorkspaceEntity } from 'src/modules/workspace-member/standard-objects/workspace-member.workspace-entity';
|
||||
import { OnDatabaseEvent } from 'src/engine/api/graphql/graphql-query-runner/decorators/on-database-event.decorator';
|
||||
import { DatabaseEventAction } from 'src/engine/api/graphql/graphql-query-runner/enums/database-event-action';
|
||||
|
||||
@Injectable()
|
||||
export class CalendarEventParticipantWorkspaceMemberListener {
|
||||
@ -25,7 +26,7 @@ export class CalendarEventParticipantWorkspaceMemberListener {
|
||||
private readonly messageQueueService: MessageQueueService,
|
||||
) {}
|
||||
|
||||
@OnEvent('workspaceMember.created')
|
||||
@OnDatabaseEvent('workspaceMember', DatabaseEventAction.CREATED)
|
||||
async handleCreatedEvent(
|
||||
payload: WorkspaceEventBatch<
|
||||
ObjectRecordCreateEvent<WorkspaceMemberWorkspaceEntity>
|
||||
@ -47,7 +48,7 @@ export class CalendarEventParticipantWorkspaceMemberListener {
|
||||
}
|
||||
}
|
||||
|
||||
@OnEvent('workspaceMember.updated')
|
||||
@OnDatabaseEvent('workspaceMember', DatabaseEventAction.UPDATED)
|
||||
async handleUpdatedEvent(
|
||||
payload: WorkspaceEventBatch<
|
||||
ObjectRecordUpdateEvent<WorkspaceMemberWorkspaceEntity>
|
||||
|
||||
Reference in New Issue
Block a user