refs #5837 fix filter existingClient France
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Carlos Satorres 2023-07-14 09:40:16 +02:00
parent 0d308ec8ad
commit 6d8b3e346d
1 changed files with 8 additions and 3 deletions

View File

@ -50,9 +50,14 @@ module.exports = Self => {
]
}
};
const client = await Self.app.models.Client.findOne(filter);
if (client)
err();
const existingClient = await Self.app.models.Client.findOne(filter);
if (existingClient) {
if (this.countryFk !== 19 && this.socialName === existingClient.socialName)
err();
}
done();
}