Add all webhook events

This commit is contained in:
Yang Luo
2023-08-26 23:39:02 +08:00
parent a637707e77
commit 7e3c361ce7
4 changed files with 27 additions and 12 deletions

View File

@ -159,6 +159,17 @@ class WebhookEditPage extends React.Component {
});
}
getApiPaths() {
const objects = ["organization", "group", "user", "application", "provider", "resource", "cert", "role", "permission", "model", "adapter", "enforcer", "session", "record", "token", "product", "payment", "plan", "pricing", "subscription", "syncer", "webhook"];
const res = [];
objects.forEach(obj => {
["add", "update", "delete"].forEach(action => {
res.push(`${action}-${obj}`);
});
});
return res;
}
renderWebhook() {
const preview = Setting.deepCopy(previewTemplate);
if (this.state.webhook.isUserExtended) {
@ -263,7 +274,7 @@ class WebhookEditPage extends React.Component {
}} >
{
(
["signup", "login", "logout", "add-user", "update-user", "delete-user", "add-organization", "update-organization", "delete-organization", "add-application", "update-application", "delete-application", "add-provider", "update-provider", "delete-provider", "update-subscription"].map((option, index) => {
["signup", "login", "logout"].concat(this.getApiPaths()).map((option, index) => {
return (
<Option key={option} value={option}>{option}</Option>
);