chore(webhooks): simplify registering webhook events
This commit is contained in:
parent
ec4aa606e2
commit
1b82f26d3e
@ -66,22 +66,24 @@ func RegisterListeners() {
|
||||
events.RegisterListener((&TaskDeletedEvent{}).Name(), &RemoveTaskFromTypesense{})
|
||||
events.RegisterListener((&TaskCreatedEvent{}).Name(), &AddTaskToTypesense{})
|
||||
}
|
||||
RegisterEventForWebhook(&TaskCreatedEvent{})
|
||||
RegisterEventForWebhook(&TaskUpdatedEvent{})
|
||||
RegisterEventForWebhook(&TaskDeletedEvent{})
|
||||
RegisterEventForWebhook(&TaskAssigneeCreatedEvent{})
|
||||
RegisterEventForWebhook(&TaskAssigneeDeletedEvent{})
|
||||
RegisterEventForWebhook(&TaskCommentCreatedEvent{})
|
||||
RegisterEventForWebhook(&TaskCommentUpdatedEvent{})
|
||||
RegisterEventForWebhook(&TaskCommentDeletedEvent{})
|
||||
RegisterEventForWebhook(&TaskAttachmentCreatedEvent{})
|
||||
RegisterEventForWebhook(&TaskAttachmentDeletedEvent{})
|
||||
RegisterEventForWebhook(&TaskRelationCreatedEvent{})
|
||||
RegisterEventForWebhook(&TaskRelationDeletedEvent{})
|
||||
RegisterEventForWebhook(&ProjectUpdatedEvent{})
|
||||
RegisterEventForWebhook(&ProjectDeletedEvent{})
|
||||
RegisterEventForWebhook(&ProjectSharedWithUserEvent{})
|
||||
RegisterEventForWebhook(&ProjectSharedWithTeamEvent{})
|
||||
if config.WebhooksEnabled.GetBool() {
|
||||
RegisterEventForWebhook(&TaskCreatedEvent{})
|
||||
RegisterEventForWebhook(&TaskUpdatedEvent{})
|
||||
RegisterEventForWebhook(&TaskDeletedEvent{})
|
||||
RegisterEventForWebhook(&TaskAssigneeCreatedEvent{})
|
||||
RegisterEventForWebhook(&TaskAssigneeDeletedEvent{})
|
||||
RegisterEventForWebhook(&TaskCommentCreatedEvent{})
|
||||
RegisterEventForWebhook(&TaskCommentUpdatedEvent{})
|
||||
RegisterEventForWebhook(&TaskCommentDeletedEvent{})
|
||||
RegisterEventForWebhook(&TaskAttachmentCreatedEvent{})
|
||||
RegisterEventForWebhook(&TaskAttachmentDeletedEvent{})
|
||||
RegisterEventForWebhook(&TaskRelationCreatedEvent{})
|
||||
RegisterEventForWebhook(&TaskRelationDeletedEvent{})
|
||||
RegisterEventForWebhook(&ProjectUpdatedEvent{})
|
||||
RegisterEventForWebhook(&ProjectDeletedEvent{})
|
||||
RegisterEventForWebhook(&ProjectSharedWithUserEvent{})
|
||||
RegisterEventForWebhook(&ProjectSharedWithTeamEvent{})
|
||||
}
|
||||
}
|
||||
|
||||
//////
|
||||
|
@ -72,10 +72,6 @@ func init() {
|
||||
}
|
||||
|
||||
func RegisterEventForWebhook(event events.Event) {
|
||||
if !config.WebhooksEnabled.GetBool() {
|
||||
return
|
||||
}
|
||||
|
||||
availableWebhookEventsLock.Lock()
|
||||
defer availableWebhookEventsLock.Unlock()
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user