remove unused code

This commit is contained in:
MaysWind
2021-01-05 23:10:23 +08:00
parent 14c2320267
commit 5820952edb
2 changed files with 1 additions and 8 deletions
-2
View File
@@ -151,8 +151,6 @@ func startWebServer(c *cli.Context) error {
if config.EnableUserRegister {
apiRoute.POST("/register.json", bindApi(api.Users.UserRegisterHandler))
} else {
apiRoute.POST("/register.json", bindApi(api.Users.UserRegistrationNotAllowed))
}
if config.EnableDataExport {
+1 -6
View File
@@ -29,7 +29,7 @@ var (
// UserRegisterHandler saves a new user by request parameters
func (a *UsersApi) UserRegisterHandler(c *core.Context) (interface{}, *errs.Error) {
if !settings.Container.Current.EnableUserRegister {
return a.UserRegistrationNotAllowed(c)
return nil, errs.ErrUserRegistrationNotAllowed
}
var userRegisterReq models.UserRegisterRequest
@@ -81,11 +81,6 @@ func (a *UsersApi) UserRegisterHandler(c *core.Context) (interface{}, *errs.Erro
return authResp, nil
}
// UserRegistrationNotAllowed returns user registration not allowed error
func (a *UsersApi) UserRegistrationNotAllowed(c *core.Context) (interface{}, *errs.Error) {
return nil, errs.ErrUserRegistrationNotAllowed
}
// UserProfileHandler returns user profile of current user
func (a *UsersApi) UserProfileHandler(c *core.Context) (interface{}, *errs.Error) {
uid := c.GetCurrentUid()