mirror of
https://github.com/strapi/strapi.git
synced 2025-08-11 10:18:28 +00:00
fix: ignore yup test validation if stage array is empty
This commit is contained in:
parent
490a8c239e
commit
252b616804
@ -64,7 +64,7 @@ const validateWorkflowUpdateSchema = yup.object().shape({
|
||||
.test('unique', function (stages) {
|
||||
const errors = [];
|
||||
|
||||
stages.forEach((stage, index) => {
|
||||
stages?.forEach((stage, index) => {
|
||||
const sameNameStages = stages.filter((s) => s.name === stage.name);
|
||||
if (sameNameStages.length > 1) {
|
||||
errors.push(
|
||||
|
Loading…
x
Reference in New Issue
Block a user