Add support for providing user name and password when creating user

This commit is contained in:
Stefan Kostic
2022-02-09 22:53:46 +01:00
parent 3f4cc70d22
commit 80a4d4f20c
2 changed files with 14 additions and 5 deletions

View File

@@ -25,6 +25,8 @@ type CreateUserResponseBody struct {
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"`
}
@@ -33,7 +35,7 @@ func (controller *CreateUserController) CreateUser(c echo.Context) error {
if err := c.Bind(&body); err != nil {
return err
}
user, err := controller.svc.CreateUser(c.Request().Context())
user, err := controller.svc.CreateUser(c.Request().Context(), body.Login, body.Password)
//todo json response
if err != nil {
return err