Skip to content

Commit

Permalink
Merge pull request #12192 from strapi/enhancement/enable-to-trigger-e…
Browse files Browse the repository at this point in the history
…mpty-events-webhook-v3

[V3] Enable to trigger empty events webhook
  • Loading branch information
soupette committed Jan 14, 2022
2 parents 53e8381 + 13f37e9 commit 6e3a134
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,7 @@ const schema = yup.object().shape({
})
);
}),
events: yup
.array()
.min(1, translatedErrors.min)
.required(translatedErrors.required),
events: yup.array(),
});

export default schema;
16 changes: 6 additions & 10 deletions packages/strapi-admin/controllers/Webhooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,12 @@ const webhookValidator = yup
)
.required();
}),
events: yup
.array()
.of(
yup
.string()
.oneOf(_.values(webhookUtils.webhookEvents))
.required()
)
.min(1)
.required(),
events: yup.array().of(
yup
.string()
.oneOf(_.values(webhookUtils.webhookEvents))
.required()
),
})
.noUnknown();

Expand Down

0 comments on commit 6e3a134

Please sign in to comment.