diff --git a/controllers/create.ctrl.go b/controllers/create.ctrl.go index e777d5a..5f5f314 100644 --- a/controllers/create.ctrl.go +++ b/controllers/create.ctrl.go @@ -20,17 +20,17 @@ type CreateUserResponseBody struct { Login string `json:"login"` Password string `json:"password"` } +type CreateUserRequestBody struct { + Login string `json:"login"` + Password string `json:"password"` + PartnerID string `json:"partnerid"` + AccountType string `json:"accounttype"` +} // CreateUser : Create user Controller func (controller *CreateUserController) CreateUser(c echo.Context) error { - // optional parameters that we currently do not use - type RequestBody struct { - Login string `json:"login"` - Password string `json:"password"` - PartnerID string `json:"partnerid"` - AccountType string `json:"accounttype"` - } - var body RequestBody + + var body CreateUserRequestBody if err := c.Bind(&body); err != nil { return err diff --git a/integration_tests/create_test.go b/integration_tests/create_test.go index d2385d3..0ba54d9 100644 --- a/integration_tests/create_test.go +++ b/integration_tests/create_test.go @@ -66,7 +66,7 @@ func (suite *CreateUserTestSuite) TestCreateWithProvidedLoginAndPassword() { var buf bytes.Buffer const testLogin = "test login" const testPassword = "test password" - json.NewEncoder(&buf).Encode(&controllers.AuthRequestBody{ + json.NewEncoder(&buf).Encode(&controllers.CreateUserRequestBody{ Login: testLogin, Password: testPassword, })