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 changes = ctx.data || ctx.instance;
|
||||||
const orgData = ctx.currentInstance;
|
const orgData = ctx.currentInstance;
|
||||||
|
|
||||||
const socialName = changes.name || orgData.name;
|
const name = changes.name || orgData.name;
|
||||||
const hasChanges = orgData && changes;
|
const hasChanges = orgData && changes;
|
||||||
const socialNameChanged = hasChanges
|
const nameChanged = hasChanges
|
||||||
&& orgData.socialName != socialName;
|
&& orgData.name != name;
|
||||||
|
|
||||||
if ((socialNameChanged) && !isAlpha(socialName))
|
if ((nameChanged) && !isAlpha(name))
|
||||||
throw new UserError('The social name has an invalid format');
|
throw new UserError('The social name has an invalid format');
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue