func createUser(name, email, password string, companyId int, roles []user.RoleType) (err error) { c := user.NewCreation(name, email, password, companyId, roles) log.Println(utils.Sdump(c)) if err = c.Do(); err != nil { return } return }
func (c *UserController) PostCreate() { roles := []user.RoleType{user.RoleType(c.GetString("role"))} companyId, _ := c.GetInt("company") err := user.NewCreation(c.GetString("name"), c.GetString("email"), "123456", companyId, roles).Do() if err != nil { c.SetJsonResponse("error", err.Error()) } c.GetJsonResponse().ServeJson() }