Skip to content

Commit e4fdc92

Browse files
committed
fix: typos and confusion between contact and contactDTO
1 parent 25e7f52 commit e4fdc92

File tree

3 files changed

+5
-9
lines changed

3 files changed

+5
-9
lines changed

src/contactInfo/domain/useCases/SubmitContactInfo.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,13 @@ export class SubmitContactInfo implements UseCase<Contact[]> {
1111
}
1212

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

2020
async execute(contactDTO: ContactDTO): Promise<Contact[]> {
21-
try {
22-
return await this.contactRepository.submitContactInfo(contactDTO)
23-
} catch (error) {
24-
throw new Error(`${error.message}`)
25-
}
21+
return await this.contactRepository.submitContactInfo(contactDTO)
2622
}
2723
}

test/integration/contact/ContactRepository.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ describe('submitContactInfo', () => {
2121

2222
const sut: ContactRepository = new ContactRepository()
2323

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

2727
expect(contactInfo).toBeDefined()

test/unit/contact/SubmitContactInfo.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { SubmitContactInfo } from '../../../src/contactInfo/domain/useCases/Subm
33
import { IContactRepository } from '../../../src/contactInfo/domain/repositories/IContactRepository'
44

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

99
const contactDTO: ContactDTO = {

0 commit comments

Comments
 (0)