fix: rename title -> event_description

This commit is contained in:
Lakhan Samani
2023-03-26 07:48:06 +05:30
parent deaf1e2ff7
commit a38e9d4e6c
14 changed files with 153 additions and 149 deletions

View File

@@ -19,8 +19,8 @@ func (p *provider) AddWebhook(ctx context.Context, webhook models.Webhook) (*mod
webhook.Key = webhook.ID
webhook.CreatedAt = time.Now().Unix()
webhook.UpdatedAt = time.Now().Unix()
if webhook.Title == "" {
webhook.Title = strings.Join(strings.Split(webhook.EventName, "."), " ")
if webhook.EventDescription == "" {
webhook.EventDescription = strings.Join(strings.Split(webhook.EventName, "."), " ")
}
// Add timestamp to make event name unique for legacy version
webhook.EventName = fmt.Sprintf("%s-%d", webhook.EventName, time.Now().Unix())