Skip to content

Commit

Permalink
Enable to create/trigger webhooks with no events
Browse files Browse the repository at this point in the history
  • Loading branch information
Convly committed Jan 13, 2022
1 parent 53e8381 commit 13f37e9
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 13f37e9

Please sign in to comment.