Merge pull request #353 from ANasouf/BIG-112-Customer-emails-addresses-gets-the-.-removed-when-a-new-one-is-added

fix: gmail email addresses dots gets removed
This commit is contained in:
Ahmed Bouhuolia
2024-02-10 23:39:18 +02:00
committed by GitHub
2 changed files with 8 additions and 9 deletions

View File

@@ -26,27 +26,27 @@ export default class ContactsController extends BaseController {
[...this.autocompleteQuerySchema], [...this.autocompleteQuerySchema],
this.validationResult, this.validationResult,
this.asyncMiddleware(this.autocompleteContacts.bind(this)), this.asyncMiddleware(this.autocompleteContacts.bind(this)),
this.dynamicListService.handlerErrorsToResponse this.dynamicListService.handlerErrorsToResponse,
); );
router.get( router.get(
'/:id', '/:id',
[param('id').exists().isNumeric().toInt()], [param('id').exists().isNumeric().toInt()],
this.validationResult, this.validationResult,
this.asyncMiddleware(this.getContact.bind(this)) this.asyncMiddleware(this.getContact.bind(this)),
); );
router.post( router.post(
'/:id/inactivate', '/:id/inactivate',
[param('id').exists().isNumeric().toInt()], [param('id').exists().isNumeric().toInt()],
this.validationResult, this.validationResult,
this.asyncMiddleware(this.inactivateContact.bind(this)), this.asyncMiddleware(this.inactivateContact.bind(this)),
this.handlerServiceErrors this.handlerServiceErrors,
); );
router.post( router.post(
'/:id/activate', '/:id/activate',
[param('id').exists().isNumeric().toInt()], [param('id').exists().isNumeric().toInt()],
this.validationResult, this.validationResult,
this.asyncMiddleware(this.activateContact.bind(this)), this.asyncMiddleware(this.activateContact.bind(this)),
this.handlerServiceErrors this.handlerServiceErrors,
); );
return router; return router;
} }
@@ -77,7 +77,7 @@ export default class ContactsController extends BaseController {
try { try {
const contact = await this.contactsService.getContact( const contact = await this.contactsService.getContact(
tenantId, tenantId,
contactId contactId,
); );
return res.status(200).send({ return res.status(200).send({
customer: this.transfromToResponse(contact), customer: this.transfromToResponse(contact),
@@ -105,7 +105,7 @@ export default class ContactsController extends BaseController {
try { try {
const contacts = await this.contactsService.autocompleteContacts( const contacts = await this.contactsService.autocompleteContacts(
tenantId, tenantId,
filter filter,
); );
return res.status(200).send({ contacts }); return res.status(200).send({ contacts });
} catch (error) { } catch (error) {
@@ -153,7 +153,6 @@ export default class ContactsController extends BaseController {
check('email') check('email')
.optional({ nullable: true }) .optional({ nullable: true })
.isString() .isString()
.normalizeEmail()
.isEmail() .isEmail()
.isLength({ max: DATATYPES_LENGTH.STRING }), .isLength({ max: DATATYPES_LENGTH.STRING }),
check('website') check('website')
@@ -380,7 +379,7 @@ export default class ContactsController extends BaseController {
error: Error, error: Error,
req: Request, req: Request,
res: Response, res: Response,
next: NextFunction next: NextFunction,
) { ) {
if (error instanceof ServiceError) { if (error instanceof ServiceError) {
if (error.errorType === 'contact_not_found') { if (error.errorType === 'contact_not_found') {

View File

@@ -66,7 +66,7 @@ export function DetailItem({ label, children, name, align, className }) {
> >
{label} {label}
</div> </div>
<div class="detail-item__content">{children}</div> <div>{children}</div>
</div> </div>
); );
} }