code: func newPostMemberHandler(s platform.UserResourceMappingService, userService platform.UserService, resourceType platform.Resource, userType platform.UserType) http.HandlerFunc {
  	return func(w http.ResponseWriter, r *http.Request) {
  		ctx := r.Context()
  
  		req, err := decodePostMemberRequest(ctx, r)
  		if err != nil {
  			EncodeError(ctx, err, w)
  			return
  		}
  
  		user, err := userService.FindUserByID(ctx, req.MemberID)
  		if err != nil {
  			EncodeError(ctx, err, w)
  			return
  		}
  
  		mapping := &platform.UserResourceMapping{
  			ResourceID: req.ResourceID,
  			Resource:   resourceType,
  			UserID:     req.MemberID,
  			UserType:   userType,
  		}
  
  		if err := s.CreateUserResourceMapping(ctx, mapping); err != nil {
  			EncodeError(ctx, err, w)
  			return
  		}
  
  		if err := encodeResponse(ctx, w, http.StatusCreated, newResourceUserResponse(user, userType)); err != nil {
  			EncodeError(ctx, err, w)
  			return
  		}
  	}
  }
docs: // newPostMemberHandler returns a handler func for a POST to /members or /owners endpoints