2455 - Validate socialname when isDataChecked is changed
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
This commit is contained in:
parent
eb99ce2f43
commit
503e1d0ed9
|
@ -186,10 +186,16 @@ module.exports = Self => {
|
||||||
let payMethodWithIban = 4;
|
let payMethodWithIban = 4;
|
||||||
|
|
||||||
// Validate socialName format
|
// Validate socialName format
|
||||||
const socialNameChanged = orgData && changes
|
const socialName = changes.socialName || orgData.socialName;
|
||||||
&& orgData.socialName != changes.socialName;
|
const isTaxDataChecked = changes.isTaxDataChecked || orgData.isTaxDataChecked;
|
||||||
|
const hasChanges = orgData && changes;
|
||||||
|
|
||||||
if (socialNameChanged && !isAlpha(changes.socialName))
|
const socialNameChanged = hasChanges
|
||||||
|
&& orgData.socialName != socialName;
|
||||||
|
const dataCheckedChanged = hasChanges
|
||||||
|
&& orgData.isTaxDataChecked != isTaxDataChecked;
|
||||||
|
|
||||||
|
if ((socialNameChanged || dataCheckedChanged) && !isAlpha(socialName))
|
||||||
throw new UserError('The socialName has an invalid format');
|
throw new UserError('The socialName has an invalid format');
|
||||||
|
|
||||||
if (changes.salesPerson === null) {
|
if (changes.salesPerson === null) {
|
||||||
|
|
Loading…
Reference in New Issue