-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Milestone
Description
We need to add webhooks around each model event and also any other important API calls. Example:
package subscriber
import (
"crowdstart.com/util/webhook"
)
// Hooks
func (s *Subscriber) AfterCreate() error {
return webhook.Emit(s.Context(), s.Namespace(), "subscriber.created", s)
}
func (s *Subscriber) AfterUpdate(previous *Subscriber) error {
return webhook.Emit(s.Context(), s.Namespace(), "subscriber.updated", s, prev)
}
func (s *Subscriber) AfterDelete() error {
return webhook.Emit(s.Context(), s.Namespace(), "subscriber.deleted", s)
}
Models that need this:
- bundle
- collection
- coupon
- mailinglist
- order
- organization (only in default namespace)
- payment
- plan
- product
- referral
- referrer
- site
- store
- submission
- subscriber
- transaction
- user (also in default namespace)
- variant
Metadata
Metadata
Assignees
Labels
No labels