cau #103812 hotFix(supplier): beforeSave name
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Alex Moreno 2023-08-16 08:04:32 +02:00
parent e5c47a2057
commit 868fbbfc2e
1 changed files with 4 additions and 4 deletions

View File

@ -142,12 +142,12 @@ module.exports = Self => {
const changes = ctx.data || ctx.instance;
const orgData = ctx.currentInstance;
const socialName = changes.name || orgData.name;
const name = changes.name || orgData.name;
const hasChanges = orgData && changes;
const socialNameChanged = hasChanges
&& orgData.socialName != socialName;
const nameChanged = hasChanges
&& orgData.name != name;
if ((socialNameChanged) && !isAlpha(socialName))
if ((nameChanged) && !isAlpha(name))
throw new UserError('The social name has an invalid format');
});
};