Skip to content

Commit

Permalink
♻️ refactor: use shared Joi email validation instead of regexp
Browse files Browse the repository at this point in the history
  • Loading branch information
yaf authored Nov 28, 2024
1 parent cd399f7 commit 492483b
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 58 deletions.
12 changes: 0 additions & 12 deletions api/lib/domain/services/email-validator.js

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { createReadStream } from 'node:fs';

import { emailIsValid } from '../../../../lib/domain/services/email-validator.js';
import { DomainTransaction } from '../../../shared/domain/DomainTransaction.js';
import * as emailValidationService from '../../../shared/domain/services/email-validation-service.js';
import { CsvColumn } from '../../../shared/infrastructure/serializers/csv/csv-column.js';
import { CsvParser } from '../../../shared/infrastructure/serializers/csv/csv-parser.js';
import { getDataBuffer } from '../../../shared/infrastructure/utils/buffer.js';
Expand Down Expand Up @@ -117,7 +117,7 @@ async function checkOrganizationUpdate(organizationBatchUpdateDto, organizationF

if (
organizationBatchUpdateDto.dataProtectionOfficerEmail &&
!emailIsValid(organizationBatchUpdateDto.dataProtectionOfficerEmail)
!emailValidationService.validateEmailSyntax(organizationBatchUpdateDto.dataProtectionOfficerEmail)
) {
throw new DpoEmailInvalid({
meta: {
Expand Down
44 changes: 0 additions & 44 deletions api/tests/unit/domain/services/email-validator_test.js

This file was deleted.

0 comments on commit 492483b

Please sign in to comment.