From fbe26fa059433c776b938e4ae992ede1c1b08ae2 Mon Sep 17 00:00:00 2001
From: Camilo Vega <59750365+camilovegag@users.noreply.github.com>
Date: Tue, 28 May 2024 02:12:21 -0500
Subject: [PATCH] 574 swap usernames to full names on comments page (#575)
* Change group names to voter affiliations
* Update comments response type
* Show full name instead of username
---
packages/api/src/types/CommentType.ts | 9 ++++++++-
.../components/tables/comment-table/CommentsTable.tsx | 4 +++-
.../src/components/tables/results-table/ResultsTable.tsx | 2 +-
3 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/packages/api/src/types/CommentType.ts b/packages/api/src/types/CommentType.ts
index df97de20..ae006265 100644
--- a/packages/api/src/types/CommentType.ts
+++ b/packages/api/src/types/CommentType.ts
@@ -11,7 +11,14 @@ export type GetCommentsRequest = {
optionId: string;
};
-export type GetCommentsResponse = (Comment & { user?: { id: string; username: string } })[];
+export type GetCommentsResponse = (Comment & {
+ user?: {
+ id: string;
+ username: string;
+ firstName: string;
+ lastName: string;
+ };
+})[];
export type PostCommentRequest = {
value: string;
diff --git a/packages/berlin/src/components/tables/comment-table/CommentsTable.tsx b/packages/berlin/src/components/tables/comment-table/CommentsTable.tsx
index 725460d9..6580aac1 100644
--- a/packages/berlin/src/components/tables/comment-table/CommentsTable.tsx
+++ b/packages/berlin/src/components/tables/comment-table/CommentsTable.tsx
@@ -103,7 +103,9 @@ function CommentsTable({ comment }: CommentsTableProps) {