Chore: Remove GetUserByEmail and GetUserByLogin from sqlstore (#55903)

* Chore: Remove GetUserByEmail and GetUserByLogin from sqlstore
 Rename GetUserProfile to GetProfile

* Fix lint

* Skip test for mysql

* Add missing method to sqlstore mock
This commit is contained in:
idafurjes
2022-09-28 13:18:19 +02:00
committed by GitHub
parent a8f43b97a2
commit a45ef61d25
14 changed files with 279 additions and 261 deletions
+1 -1
View File
@@ -716,7 +716,7 @@ func TestOrgUsersAPIEndpointWithSetPerms_AccessControl(t *testing.T) {
sc := setupHTTPServer(t, true, func(hs *HTTPServer) {
hs.tempUserService = tempuserimpl.ProvideService(hs.SQLStore)
hs.userService = userimpl.ProvideService(
hs.SQLStore, nil, nil, hs.SQLStore.(*sqlstore.SQLStore),
hs.SQLStore, nil, setting.NewCfg(), hs.SQLStore.(*sqlstore.SQLStore),
)
})
setInitCtxSignedInViewer(sc.initCtx)
+1 -1
View File
@@ -51,7 +51,7 @@ func (hs *HTTPServer) GetUserByID(c *models.ReqContext) response.Response {
func (hs *HTTPServer) getUserUserProfile(c *models.ReqContext, userID int64) response.Response {
query := user.GetUserProfileQuery{UserID: userID}
userProfile, err := hs.userService.GetUserProfile(c.Req.Context(), &query)
userProfile, err := hs.userService.GetProfile(c.Req.Context(), &query)
if err != nil {
if errors.Is(err, user.ErrUserNotFound) {
return response.Error(404, user.ErrUserNotFound.Error(), nil)