diff --git a/packages/api/src/crm/contact/contact.controller.ts b/packages/api/src/crm/contact/contact.controller.ts index eaf80b492..fb79631f1 100644 --- a/packages/api/src/crm/contact/contact.controller.ts +++ b/packages/api/src/crm/contact/contact.controller.ts @@ -1,16 +1,22 @@ import { Controller, Post, Body, Query } from '@nestjs/common'; import { ContactService } from './services/contact.service'; import { UnifiedContactInput } from './dto/create-contact.dto'; +import { LoggerService } from 'src/@core/logger/logger.service'; @Controller('crm/contact') export class ContactController { - constructor(private readonly contactService: ContactService) {} + constructor( + private readonly contactService: ContactService, + private logger: LoggerService, + ) { + this.logger.setContext(ContactController.name); + } @Post() addContact( @Body() unfiedContactData: UnifiedContactInput, - @Query() integrationId: string, - @Query() linkedUserId: string, + @Query('integrationId') integrationId: string, + @Query('linkedUserId') linkedUserId: string, ) { return this.contactService.addContact( unfiedContactData, diff --git a/packages/api/src/crm/contact/services/contact.service.ts b/packages/api/src/crm/contact/services/contact.service.ts index 6adeb611a..0240eb12a 100644 --- a/packages/api/src/crm/contact/services/contact.service.ts +++ b/packages/api/src/crm/contact/services/contact.service.ts @@ -21,6 +21,7 @@ import { ZohoContactInput, ZohoContactOutput, } from 'src/crm/@types'; +import { LoggerService } from 'src/@core/logger/logger.service'; export type ContactOutput = | FreshsalesContactOutput @@ -38,7 +39,10 @@ export class ContactService { private zoho: ZohoService, private zendesk: ZendeskService, private pipedrive: PipedriveService, - ) {} + private logger: LoggerService, + ) { + this.logger.setContext(ContactService.name); + } //utils functions normalizeEmailsAndNumbers(