Skip to content

Commit

Permalink
Merge pull request #257 from cmu15122/jtromero/fixPersonalStatsPagina…
Browse files Browse the repository at this point in the history
…tion

Fix pagination with unique keys
  • Loading branch information
jacksontromero authored Jan 13, 2024
2 parents 364acca + 3f03d73 commit 7cff516
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions client/src/components/metrics/AdminMetrics.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export default function AdminMetrics() {
.slice(studentPage * rowsPerStudentPage, studentPage * rowsPerStudentPage + rowsPerStudentPage)
.map((row) => {
return (
<TableRow hover role="checkbox" tabIndex={-1} key={row.andrewId}>
<TableRow hover role="checkbox" tabIndex={-1} key={row.student_andrew}>
{studentCols.map((column) => {
const value = row[column.id];
return (
Expand Down Expand Up @@ -149,7 +149,7 @@ export default function AdminMetrics() {
.slice(taPage * rowsPerTAPage, taPage * rowsPerTAPage + rowsPerTAPage)
.map((row) => {
return (
<TableRow hover role="checkbox" tabIndex={-1} key={row.andrewId}>
<TableRow hover role="checkbox" tabIndex={-1} key={row.ta_andrew}>
{taCols.map((column) => {
const value = row[column.id];
return (
Expand Down
4 changes: 2 additions & 2 deletions client/src/components/metrics/PersonalStats.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,9 @@ export default function PersonalStats() {
<TableBody>
{helpedStudents
.slice(page * rowsPerPage, page * rowsPerPage + rowsPerPage)
.map((row) => {
.map((row, i) => {
return (
<TableRow hover role="checkbox" tabIndex={-1} key={row.andrewId}>
<TableRow hover role="checkbox" tabIndex={-1} key={row.andrewId + i}>
{columns.map((column) => {
const value = row[column.id];
return (
Expand Down

0 comments on commit 7cff516

Please sign in to comment.