Skip to content

Commit

Permalink
feat: hubspot add-contact works
Browse files Browse the repository at this point in the history
  • Loading branch information
naelob committed Nov 15, 2023
1 parent 98e6a0a commit e8d63e2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
12 changes: 9 additions & 3 deletions packages/api/src/crm/contact/contact.controller.ts
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
6 changes: 5 additions & 1 deletion packages/api/src/crm/contact/services/contact.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import {
ZohoContactInput,
ZohoContactOutput,
} from 'src/crm/@types';
import { LoggerService } from 'src/@core/logger/logger.service';

export type ContactOutput =
| FreshsalesContactOutput
Expand All @@ -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(
Expand Down

0 comments on commit e8d63e2

Please sign in to comment.