diff --git a/apps/api-gql/internal/gql/resolvers/admin-actions.resolver.go b/apps/api-gql/internal/gql/resolvers/admin-actions.resolver.go index 43b5f5dc2..1e73c8d53 100644 --- a/apps/api-gql/internal/gql/resolvers/admin-actions.resolver.go +++ b/apps/api-gql/internal/gql/resolvers/admin-actions.resolver.go @@ -33,10 +33,7 @@ func (r *mutationResolver) DropAllAuthSessions(ctx context.Context) (bool, error } // EventsubSubscribe is the resolver for the eventsubSubscribe field. -func (r *mutationResolver) EventsubSubscribe( - ctx context.Context, - opts gqlmodel.EventsubSubscribeInput, -) (bool, error) { +func (r *mutationResolver) EventsubSubscribe(ctx context.Context, opts gqlmodel.EventsubSubscribeInput) (bool, error) { var channels []model.Channels if err := r.gorm. WithContext(ctx). diff --git a/apps/api-gql/internal/gql/resolvers/user.resolver.go b/apps/api-gql/internal/gql/resolvers/user.resolver.go index 7addd4e44..529a6a1b8 100644 --- a/apps/api-gql/internal/gql/resolvers/user.resolver.go +++ b/apps/api-gql/internal/gql/resolvers/user.resolver.go @@ -11,7 +11,7 @@ import ( "github.com/google/uuid" "github.com/guregu/null" - "github.com/nicklaw5/helix/v2" + helix "github.com/nicklaw5/helix/v2" "github.com/samber/lo" model "github.com/satont/twir/libs/gomodels" data_loader "github.com/twirapp/twir/apps/api-gql/internal/gql/data-loader" @@ -21,42 +21,27 @@ import ( ) // TwitchProfile is the resolver for the twitchProfile field. -func (r *authenticatedUserResolver) TwitchProfile( - ctx context.Context, - obj *gqlmodel.AuthenticatedUser, -) (*gqlmodel.TwirUserTwitchInfo, error) { +func (r *authenticatedUserResolver) TwitchProfile(ctx context.Context, obj *gqlmodel.AuthenticatedUser) (*gqlmodel.TwirUserTwitchInfo, error) { return data_loader.GetHelixUserById(ctx, obj.ID) } // SelectedDashboardTwitchUser is the resolver for the selectedDashboardTwitchUser field. -func (r *authenticatedUserResolver) SelectedDashboardTwitchUser( - ctx context.Context, - obj *gqlmodel.AuthenticatedUser, -) (*gqlmodel.TwirUserTwitchInfo, error) { +func (r *authenticatedUserResolver) SelectedDashboardTwitchUser(ctx context.Context, obj *gqlmodel.AuthenticatedUser) (*gqlmodel.TwirUserTwitchInfo, error) { return data_loader.GetHelixUserById(ctx, obj.SelectedDashboardID) } // AvailableDashboards is the resolver for the availableDashboards field. -func (r *authenticatedUserResolver) AvailableDashboards( - ctx context.Context, - obj *gqlmodel.AuthenticatedUser, -) ([]gqlmodel.Dashboard, error) { +func (r *authenticatedUserResolver) AvailableDashboards(ctx context.Context, obj *gqlmodel.AuthenticatedUser) ([]gqlmodel.Dashboard, error) { return r.getAvailableDashboards(ctx, obj) } // TwitchProfile is the resolver for the twitchProfile field. -func (r *dashboardResolver) TwitchProfile( - ctx context.Context, - obj *gqlmodel.Dashboard, -) (*gqlmodel.TwirUserTwitchInfo, error) { +func (r *dashboardResolver) TwitchProfile(ctx context.Context, obj *gqlmodel.Dashboard) (*gqlmodel.TwirUserTwitchInfo, error) { return data_loader.GetHelixUserById(ctx, obj.ID) } // AuthenticatedUserSelectDashboard is the resolver for the authenticatedUserSelectDashboard field. -func (r *mutationResolver) AuthenticatedUserSelectDashboard( - ctx context.Context, - dashboardID string, -) (bool, error) { +func (r *mutationResolver) AuthenticatedUserSelectDashboard(ctx context.Context, dashboardID string) (bool, error) { if err := r.sessions.SetSelectedDashboard(ctx, dashboardID); err != nil { return false, err } @@ -65,10 +50,7 @@ func (r *mutationResolver) AuthenticatedUserSelectDashboard( } // AuthenticatedUserUpdateSettings is the resolver for the authenticatedUserUpdateSettings field. -func (r *mutationResolver) AuthenticatedUserUpdateSettings( - ctx context.Context, - opts gqlmodel.UserUpdateSettingsInput, -) (bool, error) { +func (r *mutationResolver) AuthenticatedUserUpdateSettings(ctx context.Context, opts gqlmodel.UserUpdateSettingsInput) (bool, error) { user, err := r.sessions.GetAuthenticatedUser(ctx) if err != nil { return false, err @@ -122,10 +104,7 @@ func (r *mutationResolver) AuthenticatedUserRegenerateAPIKey(ctx context.Context } // AuthenticatedUserUpdatePublicPage is the resolver for the authenticatedUserUpdatePublicPage field. -func (r *mutationResolver) AuthenticatedUserUpdatePublicPage( - ctx context.Context, - opts gqlmodel.UserUpdatePublicSettingsInput, -) (bool, error) { +func (r *mutationResolver) AuthenticatedUserUpdatePublicPage(ctx context.Context, opts gqlmodel.UserUpdatePublicSettingsInput) (bool, error) { user, err := r.sessions.GetAuthenticatedUser(ctx) if err != nil { return false, err @@ -201,10 +180,7 @@ func (r *mutationResolver) Logout(ctx context.Context) (bool, error) { } // AuthenticatedUser is the resolver for the authenticatedUser field. -func (r *queryResolver) AuthenticatedUser(ctx context.Context) ( - *gqlmodel.AuthenticatedUser, - error, -) { +func (r *queryResolver) AuthenticatedUser(ctx context.Context) (*gqlmodel.AuthenticatedUser, error) { sessionUser, err := r.sessions.GetAuthenticatedUser(ctx) if err != nil { return nil, fmt.Errorf("not authenticated: %w", err) @@ -243,10 +219,7 @@ func (r *queryResolver) AuthenticatedUser(ctx context.Context) ( } // UserPublicSettings is the resolver for the userPublicSettings field. -func (r *queryResolver) UserPublicSettings( - ctx context.Context, - userID *string, -) (*gqlmodel.PublicSettings, error) { +func (r *queryResolver) UserPublicSettings(ctx context.Context, userID *string) (*gqlmodel.PublicSettings, error) { dashboardId, _ := r.sessions.GetSelectedDashboard(ctx) var idForFetch string diff --git a/apps/eventsub/internal/bus-listener/bus-listener.go b/apps/eventsub/internal/bus-listener/bus-listener.go index 64faac938..99080eca2 100644 --- a/apps/eventsub/internal/bus-listener/bus-listener.go +++ b/apps/eventsub/internal/bus-listener/bus-listener.go @@ -41,14 +41,14 @@ func New(opts Opts) (*BusListener, error) { fx.Hook{ OnStart: func(ctx context.Context) error { if err := impl.bus.EventSub.SubscribeToAllEvents.SubscribeGroup( - "eventsub", + "eventsub.subscribeAll", impl.subscribeToAllEvents, ); err != nil { return err } if err := impl.bus.EventSub.Subscribe.SubscribeGroup( - "eventsub", + "eventsub.subscribe", impl.subscribe, ); err != nil { return err