You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: list_memberships.go
    path of file: ./repos/hatchet/api/v1/server/handlers/users
    
    the code of the file until where you have to start completion: package users

import (
	"github.com/labstack/echo/v4"

	"github.com/hatchet-dev/hatchet/api/v1/server/oas/gen"
	"github.com/hatchet-dev/hatchet/api/v1/server/oas/transformers"
	"github.com/hatchet-dev/hatchet/internal/repository/prisma/db"
)

func (t *UserService) TenantMembershipsList(ctx echo.Context, request gen.Ten
    
func (t *UserService) TenantMembershipsList(ctx echo.Context, request gen.TenantMembershipsListRequestObject) (gen.TenantMembershipsListResponseObject, error) {
	user := ctx.Get("user").(*db.UserModel)

	memberships, err := t.config.Repository.User().ListTenantMemberships(user.ID)

	if err != nil {
		return nil, err
	}

	rows := make([]gen.TenantMember, len(memberships))

	for i, membership := range memberships {
		membershipCp := membership
		rows[i] = *transformers.ToTenantMember(&membershipCp)
	}

	return gen.TenantMembershipsList200JSONResponse(
		gen.UserTenantMembershipsList{
			Rows: &rows,
		},
	), nil
}