Merge pull request 'MASTER_hotfix: check if email exists' (!1103) from 4708-client.basic-data into master
gitea/salix/pipeline/head This commit looks good Details

Reviewed-on: #1103
Reviewed-by: Joan Sanchez <joan@verdnatura.es>
This commit is contained in:
Joan Sanchez 2022-10-25 06:21:36 +00:00
commit 5811a0f56e
1 changed files with 2 additions and 3 deletions

View File

@ -25,10 +25,9 @@ module.exports = Self => {
const client = await Self.app.models.Client.findById(id, myOptions);
const emails = client.email ? client.email.split(',') : null;
const findParams = [];
if (emails.length) {
if (client.email) {
const emails = client.email.split(',');
for (let email of emails)
findParams.push({email: email});
}