cau #103812 hotFix(supplier): beforeSave name
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
This commit is contained in:
parent
e5c47a2057
commit
868fbbfc2e
|
@ -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');
|
||||
});
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue