Update Circle model to include webhook URL field

This commit is contained in:
Mo Tarbin 2025-02-11 22:02:15 -05:00
parent b1036730c4
commit 3fb83b0610
4 changed files with 59 additions and 9 deletions

View file

@ -14,7 +14,7 @@ type Circle struct {
UpdatedAt time.Time `json:"updated_at" gorm:"column:updated_at"` // Updated at
InviteCode string `json:"invite_code" gorm:"column:invite_code"` // Invite code
Disabled bool `json:"disabled" gorm:"column:disabled"` // Disabled
WebhookURL *string `json:"-" gorm:"column:webhook_url"` // Webhook URL
WebhookURL *string `json:"webhook_url" gorm:"column:webhook_url"` // Webhook URL
}
type CircleDetail struct {

View file

@ -167,3 +167,7 @@ func (r *CircleRepository) RedeemPoints(c context.Context, circleID int, userID
}
return nil
}
func (r *CircleRepository) SetWebhookURL(c context.Context, circleID int, webhookURL *string) error {
return r.db.WithContext(c).Model(&cModel.Circle{}).Where("id = ?", circleID).Update("webhook_url", webhookURL).Error
}