Skip to content

Commit

Permalink
Moved the action struct to a dto.
Browse files Browse the repository at this point in the history
  • Loading branch information
mattwoberts committed Sep 9, 2024
1 parent 9faf6cc commit f3265f5
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
3 changes: 2 additions & 1 deletion app/handlers/admin.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (

"github.com/getfider/fider/app/actions"
"github.com/getfider/fider/app/models/cmd"
"github.com/getfider/fider/app/models/dto"
"github.com/getfider/fider/app/models/entity"
"github.com/getfider/fider/app/models/query"
"github.com/getfider/fider/app/pkg/bus"
Expand Down Expand Up @@ -63,7 +64,7 @@ func UpdateSettings() web.HandlerFunc {

// Handle userlist.
if env.Config.UserList.Enabled {
c.Enqueue(tasks.UserListUpdateCompany(&actions.UserListUpdateCompany{
c.Enqueue(tasks.UserListUpdateCompany(&dto.UserListUpdateCompany{
TenantID: c.Tenant().ID,
Name: action.Title,
}))
Expand Down
5 changes: 2 additions & 3 deletions app/handlers/webhooks/paddle.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import (
"sort"
"time"

"github.com/getfider/fider/app/actions"
"github.com/getfider/fider/app/models/cmd"
"github.com/getfider/fider/app/models/dto"
"github.com/getfider/fider/app/models/enum"
Expand Down Expand Up @@ -71,7 +70,7 @@ func handlePaddleSubscriptionCreated(c *web.Context, params url.Values) error {

// Handle userlist.
if env.Config.UserList.Enabled {
c.Enqueue(tasks.UserListUpdateCompany(&actions.UserListUpdateCompany{
c.Enqueue(tasks.UserListUpdateCompany(&dto.UserListUpdateCompany{
TenantID: passthrough.TenantID,
BillingStatus: enum.BillingActive,
Name: c.Tenant().Name,
Expand Down Expand Up @@ -105,7 +104,7 @@ func handlePaddleSubscriptionCancelled(c *web.Context, params url.Values) error

// Handle userlist.
if env.Config.UserList.Enabled {
c.Enqueue(tasks.UserListUpdateCompany(&actions.UserListUpdateCompany{
c.Enqueue(tasks.UserListUpdateCompany(&dto.UserListUpdateCompany{
TenantID: passthrough.TenantID,
BillingStatus: enum.BillingCancelled,
Name: c.Tenant().Name,
Expand Down
2 changes: 1 addition & 1 deletion app/actions/userlist.go → app/models/dto/userlist.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package actions
package dto

import "github.com/getfider/fider/app/models/enum"

Expand Down
3 changes: 1 addition & 2 deletions app/tasks/userlist.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package tasks
import (
"time"

"github.com/getfider/fider/app/actions"
"github.com/getfider/fider/app/models/cmd"
"github.com/getfider/fider/app/models/dto"
"github.com/getfider/fider/app/models/entity"
Expand Down Expand Up @@ -35,7 +34,7 @@ func UserListCreateCompany(tenant entity.Tenant, user entity.User) worker.Task {
})
}

func UserListUpdateCompany(action *actions.UserListUpdateCompany) worker.Task {
func UserListUpdateCompany(action *dto.UserListUpdateCompany) worker.Task {
return describe("Update Company in UserList", func(c *worker.Context) error {
log.Debugf(c, "Updating company @{Tenant} in UserList", dto.Props{
"Tenant": action.Name,
Expand Down

0 comments on commit f3265f5

Please sign in to comment.