Skip to content

Commit

Permalink
Fix: Can't access tenant from context in paddle webhook logic (but do…
Browse files Browse the repository at this point in the history
…n't need to anyway)
  • Loading branch information
mattwoberts committed Sep 26, 2024
1 parent f4fce74 commit 261bcf4
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 3 deletions.
2 changes: 0 additions & 2 deletions app/handlers/webhooks/paddle.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ func handlePaddleSubscriptionCreated(c *web.Context, params url.Values) error {
c.Enqueue(tasks.UserListUpdateCompany(&dto.UserListUpdateCompany{
TenantID: passthrough.TenantID,
BillingStatus: enum.BillingActive,
Name: c.Tenant().Name,
}))
}

Expand Down Expand Up @@ -107,7 +106,6 @@ func handlePaddleSubscriptionCancelled(c *web.Context, params url.Values) error
c.Enqueue(tasks.UserListUpdateCompany(&dto.UserListUpdateCompany{
TenantID: passthrough.TenantID,
BillingStatus: enum.BillingCancelled,
Name: c.Tenant().Name,
}))
}

Expand Down
1 change: 1 addition & 0 deletions app/services/userlist/userlist.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ func updateUserListCompany(ctx context.Context, c *cmd.UserListUpdateCompany) er
Identifier: strconv.Itoa(c.TenantId),
Name: c.Name,
}

if c.BillingStatus > 0 {
company.Properties = map[string]interface{}{
"billing_status": c.BillingStatus,
Expand Down
2 changes: 1 addition & 1 deletion app/services/userlist/userlist_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func reset() {
bus.Init(userlist.Service{}, httpclientmock.Service{}, userlist_mock.Service{})
}

func TestCreatTenant_Success(t *testing.T) {
func TestCreateTenant_Success(t *testing.T) {
RegisterT(t)
env.Config.HostMode = "multi"
reset()
Expand Down

0 comments on commit 261bcf4

Please sign in to comment.