Skip to content

Commit

Permalink
Fix project display name when listing invitations (#3788)
Browse files Browse the repository at this point in the history
  • Loading branch information
eleftherias committed Jul 4, 2024
1 parent c01ef70 commit ac1f60a
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion internal/controlplane/handlers_user.go
Original file line number Diff line number Diff line change
Expand Up @@ -341,12 +341,19 @@ func (s *Server) ListInvitations(ctx context.Context, _ *pb.ListInvitationsReque
if err != nil {
return nil, status.Errorf(codes.Internal, "failed to get project: %s", err)
}

// Parse the project metadata, so we can get the display name set by project owner
meta, err := projects.ParseMetadata(&targetProject)
if err != nil {
return nil, status.Errorf(codes.Internal, "error parsing project metadata: %v", err)
}

invitations = append(invitations, &pb.Invitation{
Code: i.Code,
Role: i.Role,
Email: i.Email,
Project: i.Project.String(),
ProjectDisplay: targetProject.Name,
ProjectDisplay: meta.Public.DisplayName,
CreatedAt: timestamppb.New(i.CreatedAt),
ExpiresAt: invite.GetExpireIn7Days(i.UpdatedAt),
Expired: invite.IsExpired(i.UpdatedAt),
Expand Down

0 comments on commit ac1f60a

Please sign in to comment.