diff options
Diffstat (limited to 'components/pq/pq-review-table.tsx')
| -rw-r--r-- | components/pq/pq-review-table.tsx | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/components/pq/pq-review-table.tsx b/components/pq/pq-review-table.tsx index e778cf91..08b4de61 100644 --- a/components/pq/pq-review-table.tsx +++ b/components/pq/pq-review-table.tsx @@ -25,6 +25,7 @@ import { addReviewCommentAction, getItemReviewLogsAction } from "@/lib/pq/servic import { useToast } from "@/hooks/use-toast" import { formatDate } from "@/lib/utils" import { downloadFileAction } from "@/lib/downloadFile" +import { useSession } from "next-auth/react" interface ReviewLog { id: number @@ -189,6 +190,9 @@ function ItemReviewButton({ answerId, checkPoint, onCommentAdded }: ItemReviewBu const [newComment, setNewComment] = React.useState(""); const [isLoading, setIsLoading] = React.useState(false); const [hasComments, setHasComments] = React.useState(false); + const { data: session } = useSession() + const reviewerName = session?.user?.name || "Unknown Reviewer" + const reviewerId = session?.user?.id // If there's no answerId, item wasn't answered if (!answerId) { @@ -258,7 +262,7 @@ function ItemReviewButton({ answerId, checkPoint, onCommentAdded }: ItemReviewBu const res = await addReviewCommentAction({ answerId, comment: newComment, - reviewerName: "AdminUser", + reviewerName, }); if (res.ok) { |
