// UpdateUserByAdminHandler handle PUT /users

UpdateUserByAdminHandler handle PUT /users
// UpdateUserByAdminHandler handle PUT / users
func UpdateUserByAdminHandler(c *routing.Context) error {
	userService := getUserService(c)
	usersList := userService.GetUserByUsername(c.Param("username"))
	if len(usersList) == 0 {
		return http.Error(c, "User not found", 404, UsersServiceName())
	}
	user := usersList[0]
	allowedToUpdate := []string{"Email", "Password", "IsAdmin"}
	user, err := updateUserUsingUpdateBody(user, c.Request.Body(), allowedToUpdate)
	if err != nil {
		return http.Error(c, "User could not be updated", 400, UsersServiceName())
	}
	err = userService.UpdateUser(user)
	if err != nil {
		return http.Error(c, "User could not be updated", 400, UsersServiceName())
	} 
	return http.Created(c, "User updated successfuly", UsersServiceName())
}
func UpdateUserByAdminHandler ( c * routing . Context ) error { userService := getUserService ( c ) usersList := userService . GetUserByUsername ( c . Param ( " " ) ) if len ( usersList ) == 0 { return http . Error ( c , " " , 404 , UsersServiceName ( ) ) } user := usersList [ 0 ] allowedToUpdate := [ ] string { " " , " " , " " } user , err := updateUserUsingUpdateBody ( user , c . Request . Body ( ) , allowedToUpdate ) if err != nil { return http . Error ( c , " " , 400 , UsersServiceName ( ) ) } err = userService . UpdateUser ( user ) if err != nil { return http . Error ( c , " " , 400 , UsersServiceName ( ) ) } return http . Created ( c , " " , UsersServiceName ( ) ) }
UpdateUserByAdminHandler handle PUT /users
UpdateUserByAdminHandler handle PUT / users
// Get user service
 // Get user with provided username
 // Update user information
