cleaned up webhooks package

This commit is contained in:
2026-01-24 12:47:54 -07:00
parent ff231897df
commit d6d0bf1b4c
5 changed files with 13 additions and 15 deletions
@@ -20,7 +20,7 @@ type (
}
)
func Webhooks(
func Routes(
r *gin.RouterGroup,
logger *logging.Logger,
db *raw_events.Store,
@@ -38,7 +38,7 @@ func Webhooks(
r.GET(h.cfg.OAuthRedirectURIWithAcctIDParam, response.Handler(h.redirectURI))
r.GET("/{acctID}/new-account-link", response.Handler(h.newAccountLink))
r.GET("/:acctID/new-account-link", response.Handler(h.newAccountLink))
}
type (
@@ -134,7 +134,7 @@ func (h webhooks) redirectURI(c *gin.Context) (response.Response, error) {
return response.SeeOther(fmt.Sprintf("/accounts/%d", acctID)), nil
}
// GET /{acctID}/new-account-link
// GET /:acctID/new-account-link
func (h webhooks) newAccountLink(c *gin.Context) (response.Response, error) {
r := c.Request
acctIDStr := c.Param("acctID")
@@ -12,7 +12,7 @@ import (
"github.com/gin-gonic/gin"
)
func Webhooks(
func Routes(
r *gin.RouterGroup,
logger *logging.Logger,
db *raw_events.Store,
+4 -4
View File
@@ -15,26 +15,26 @@ type Config struct {
Etsy etsy.Config
}
func Webhooks(
func Routes(
r *gin.RouterGroup,
logger *logging.Logger,
eventsDB *raw_events.Store,
etsyPlatform *etsy_platform.Platform,
cfg Config,
) {
etsy.Webhooks(
etsy.Routes(
r.Group("/etsy"),
logger.WithGroup("etsy"),
eventsDB,
etsyPlatform,
cfg.Etsy,
)
tiktok.Webhooks(
tiktok.Routes(
r.Group("/tiktok"),
logger.WithGroup("tiktok"),
eventsDB,
)
wix.Webhooks(
wix.Routes(
r.Group("/wix"),
logger.WithGroup("wix"),
eventsDB,
+1 -1
View File
@@ -12,7 +12,7 @@ import (
"github.com/gin-gonic/gin"
)
func Webhooks(
func Routes(
r *gin.RouterGroup,
logger *logging.Logger,
db *raw_events.Store,