mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
parent
d33b4918cd
commit
9dc82606db
@ -10,7 +10,6 @@ import (
|
||||
"github.com/grafana/grafana/pkg/services/login"
|
||||
"github.com/grafana/grafana/pkg/services/org"
|
||||
"github.com/grafana/grafana/pkg/services/quota"
|
||||
"github.com/grafana/grafana/pkg/services/sqlstore"
|
||||
"github.com/grafana/grafana/pkg/services/user"
|
||||
)
|
||||
|
||||
@ -19,7 +18,6 @@ var (
|
||||
)
|
||||
|
||||
func ProvideService(
|
||||
sqlStore sqlstore.Store,
|
||||
userService user.Service,
|
||||
quotaService quota.Service,
|
||||
authInfoService login.AuthInfoService,
|
||||
@ -27,7 +25,6 @@ func ProvideService(
|
||||
orgService org.Service,
|
||||
) *Implementation {
|
||||
s := &Implementation{
|
||||
SQLStore: sqlStore,
|
||||
userService: userService,
|
||||
QuotaService: quotaService,
|
||||
AuthInfoService: authInfoService,
|
||||
@ -38,7 +35,6 @@ func ProvideService(
|
||||
}
|
||||
|
||||
type Implementation struct {
|
||||
SQLStore sqlstore.Store
|
||||
userService user.Service
|
||||
AuthInfoService login.AuthInfoService
|
||||
QuotaService quota.Service
|
||||
@ -49,7 +45,7 @@ type Implementation struct {
|
||||
|
||||
// CreateUser creates inserts a new one.
|
||||
func (ls *Implementation) CreateUser(cmd user.CreateUserCommand) (*user.User, error) {
|
||||
return ls.SQLStore.CreateUser(context.Background(), cmd)
|
||||
return ls.userService.Create(context.Background(), &cmd)
|
||||
}
|
||||
|
||||
// UpsertUser updates an existing user, or if it doesn't exist, inserts a new one.
|
||||
|
@ -28,7 +28,6 @@ func Test_syncOrgRoles_doesNotBreakWhenTryingToRemoveLastOrgAdmin(t *testing.T)
|
||||
login := Implementation{
|
||||
QuotaService: quotatest.New(false, nil),
|
||||
AuthInfoService: authInfoMock,
|
||||
SQLStore: nil,
|
||||
userService: usertest.NewUserServiceFake(),
|
||||
orgService: orgtest.NewOrgServiceFake(),
|
||||
}
|
||||
@ -53,7 +52,6 @@ func Test_syncOrgRoles_whenTryingToRemoveLastOrgLogsError(t *testing.T) {
|
||||
login := Implementation{
|
||||
QuotaService: quotatest.New(false, nil),
|
||||
AuthInfoService: authInfoMock,
|
||||
SQLStore: nil,
|
||||
userService: usertest.NewUserServiceFake(),
|
||||
orgService: orgService,
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user