Skip to content

Commit

Permalink
fix: typos and confusion between contact and contactDTO
Browse files Browse the repository at this point in the history
  • Loading branch information
ChengShi-1 committed Jan 6, 2025
1 parent 25e7f52 commit e4fdc92
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
10 changes: 3 additions & 7 deletions src/contactInfo/domain/useCases/SubmitContactInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,13 @@ export class SubmitContactInfo implements UseCase<Contact[]> {
}

/**
* Submits contact information and returns a DTO containing the submitted data.
* Submits contact information and returns a Contact model containing the submitted data.
*
* @param {ContactDTO} contactDTO - The contact information to be submitted.
* @returns {Promise<Contact>} A promise resolving to a ContactDTO.
* @returns {Promise<Contact[]>} A promise resolving to a ContactDTO.
*/

async execute(contactDTO: ContactDTO): Promise<Contact[]> {
try {
return await this.contactRepository.submitContactInfo(contactDTO)
} catch (error) {
throw new Error(`${error.message}`)
}
return await this.contactRepository.submitContactInfo(contactDTO)
}
}
2 changes: 1 addition & 1 deletion test/integration/contact/ContactRepository.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ describe('submitContactInfo', () => {

const sut: ContactRepository = new ContactRepository()

test('should return ContactDTO when contact info is successfully submitted', async () => {
test('should return Contact when contact info is successfully submitted', async () => {
const contactInfo = await sut.submitContactInfo(testContactDTO)

expect(contactInfo).toBeDefined()
Expand Down
2 changes: 1 addition & 1 deletion test/unit/contact/SubmitContactInfo.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { SubmitContactInfo } from '../../../src/contactInfo/domain/useCases/Subm
import { IContactRepository } from '../../../src/contactInfo/domain/repositories/IContactRepository'

describe('execute submit information to contacts', () => {
test('should return a ContactDTO when repository call is successful', async () => {
test('should return a Contact when repository call is successful', async () => {
const fromEmail = '[email protected]'

const contactDTO: ContactDTO = {
Expand Down

0 comments on commit e4fdc92

Please sign in to comment.