@@ -65,7 +65,9 @@ export class Controller {
65
65
console . log ( `[${ anonKey } ] Fetching contacts` ) ;
66
66
67
67
const fetchedContacts : Contact [ ] = await this . adapter . getContacts (
68
- req . providerConfig
68
+ req . providerConfig ,
69
+ req ,
70
+ res
69
71
) ;
70
72
71
73
if ( ! validate ( this . ajv , contactsSchema , fetchedContacts ) ) {
@@ -137,7 +139,9 @@ export class Controller {
137
139
138
140
const contact : Contact = await this . adapter . createContact (
139
141
req . providerConfig ,
140
- req . body as ContactTemplate
142
+ req . body as ContactTemplate ,
143
+ req ,
144
+ res
141
145
) ;
142
146
143
147
const valid = validate ( this . ajv , contactsSchema , [ contact ] ) ;
@@ -193,7 +197,9 @@ export class Controller {
193
197
const contact : Contact = await this . adapter . updateContact (
194
198
req . providerConfig ,
195
199
req . params . id ,
196
- req . body as ContactUpdate
200
+ req . body as ContactUpdate ,
201
+ req ,
202
+ res
197
203
) ;
198
204
199
205
const valid = validate ( this . ajv , contactsSchema , [ contact ] ) ;
@@ -246,7 +252,7 @@ export class Controller {
246
252
console . log ( `Deleting contact for key "${ anonymizeKey ( apiKey ) } "` ) ;
247
253
248
254
const contactId : string = req . params . id ;
249
- await this . adapter . deleteContact ( req . providerConfig , contactId ) ;
255
+ await this . adapter . deleteContact ( req . providerConfig , contactId , req , res ) ;
250
256
251
257
if ( this . adapter . getToken && req . providerConfig ) {
252
258
const { apiKey } = await this . adapter . getToken ( req . providerConfig ) ;
0 commit comments