From 9554d98226e1a4de6f300d945044a331adb6578b Mon Sep 17 00:00:00 2001 From: Eunbi Kang Date: Wed, 4 Sep 2024 20:02:47 +0900 Subject: [PATCH] chore(fe): minor update to the admin problem table (#2070) chore(fe): show update time instead of the create time --- .../contest/_components/ImportProblemTableColumns.tsx | 7 +++---- apps/frontend/app/admin/problem/_components/Columns.tsx | 7 +++---- apps/frontend/graphql/problem/queries.ts | 2 +- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/apps/frontend/app/admin/contest/_components/ImportProblemTableColumns.tsx b/apps/frontend/app/admin/contest/_components/ImportProblemTableColumns.tsx index 926f032a62..fcda938ddc 100644 --- a/apps/frontend/app/admin/contest/_components/ImportProblemTableColumns.tsx +++ b/apps/frontend/app/admin/contest/_components/ImportProblemTableColumns.tsx @@ -7,7 +7,7 @@ import type { ColumnDef } from '@tanstack/react-table' interface DataTableProblem { id: number title: string - createTime: string + updateTime: string difficulty: string submissionCount: number acceptedRate: number @@ -69,13 +69,12 @@ export const columns: ColumnDef[] = [ } }, { - accessorKey: 'createTime', + accessorKey: 'updateTime', header: ({ column }) => ( ), cell: ({ row }) => { - const updateTime: string = row.getValue('createTime') - return
{updateTime.substring(2, 10)}
+ return
{row.original.updateTime.substring(2, 10)}
} }, { diff --git a/apps/frontend/app/admin/problem/_components/Columns.tsx b/apps/frontend/app/admin/problem/_components/Columns.tsx index 7aefb0b07c..b797075752 100644 --- a/apps/frontend/app/admin/problem/_components/Columns.tsx +++ b/apps/frontend/app/admin/problem/_components/Columns.tsx @@ -17,7 +17,7 @@ interface Tag { interface DataTableProblem { id: number title: string - createTime: string + updateTime: string difficulty: string submissionCount: number acceptedRate: number @@ -118,13 +118,12 @@ export const columns: ColumnDef[] = [ } }, { - accessorKey: 'createTime', + accessorKey: 'updateTime', header: ({ column }) => ( ), cell: ({ row }) => { - const updateTime: string = row.getValue('createTime') - return
{updateTime.substring(2, 10)}
+ return
{row.original.updateTime.substring(2, 10)}
} }, { diff --git a/apps/frontend/graphql/problem/queries.ts b/apps/frontend/graphql/problem/queries.ts index 043a6ced24..f9c2d17bb1 100644 --- a/apps/frontend/graphql/problem/queries.ts +++ b/apps/frontend/graphql/problem/queries.ts @@ -47,7 +47,7 @@ const GET_PROBLEMS = gql(` ) { id title - createTime + updateTime difficulty submissionCount acceptedRate