File tree Expand file tree Collapse file tree 3 files changed +10
-3
lines changed Expand file tree Collapse file tree 3 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -84,5 +84,5 @@ export interface Adapter {
84
84
req : Request ,
85
85
res ?: Response ,
86
86
) => Promise < { apiKey : string ; apiUrl : string } > ;
87
- handleWebhook ?: ( body : unknown ) => Promise < ContactsChangedData > ;
87
+ handleWebhook ?: ( req : Request ) => Promise < ContactsChangedData > ;
88
88
}
Original file line number Diff line number Diff line change
1
+ import { IntegrationEntityType } from './integration-entity.model' ;
2
+
1
3
export type ContactsChangedData = {
2
4
integrationName : string ;
3
5
data : {
4
6
integrationAccountId : string ;
5
7
type : ContactsChangedDataType ;
6
8
contactId : string ;
9
+ contactType : IntegrationEntityType ;
7
10
} [ ] ;
8
11
} ;
9
12
10
- export type ContactsChangedDataType = 'UPDATE' | 'CREATE' | 'DELETE' ;
13
+ export enum ContactsChangedDataType {
14
+ UPDATE = 'UPDATE' ,
15
+ CREATE = 'CREATE' ,
16
+ DELETE = 'DELETE' ,
17
+ }
Original file line number Diff line number Diff line change @@ -1356,7 +1356,7 @@ export class Controller {
1356
1356
}
1357
1357
1358
1358
const contactsChangedData : ContactsChangedData =
1359
- await this . adapter . handleWebhook ( req . body ) ;
1359
+ await this . adapter . handleWebhook ( req ) ;
1360
1360
1361
1361
console . log ( 'sending webhook to pubsub' , contactsChangedData ) ;
1362
1362
this . pubSubContactsChangedClient ?. publishMessage ( contactsChangedData ) ;
You can’t perform that action at this time.
0 commit comments