Skip to content

Commit

Permalink
fix: datagrid failing to work correctly after package update -refs: #145
Browse files Browse the repository at this point in the history
  • Loading branch information
HRemonen committed Aug 22, 2024
1 parent fb7a5a4 commit f74c43f
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions src/client/components/Admin/Entries/RenderEntries.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react'
import { useTranslation } from 'react-i18next'
import { Link } from 'react-router-dom'
import { EntryWithSurvey, Survey } from '@backend/types'
Expand Down Expand Up @@ -36,28 +35,26 @@ const RenderEntries = () => {
field: 'Survey',
headerName: t('admin:entryViewSurvey'),
width: 200,
valueGetter: ({ value }: { value: Survey }) =>
t(`surveyNames:${value.name}`),
valueGetter: (value: Survey) => t(`surveyNames:${value.name}`),
},
{
field: 'faculty',
headerName: t('admin:entryViewFaculty'),
width: 75,
valueGetter: ({ row }: { row: EntryWithSurvey }) => row.data.faculty,
valueGetter: (_: unknown, row: EntryWithSurvey) =>
t(`faculties:${row.data.faculty}`),
},
{
field: 'createdAt',
headerName: t('admin:entryViewCreated'),
width: 175,
valueFormatter: ({ value }: { value: Date }) =>
new Date(value).toLocaleString(),
valueFormatter: (value: Date) => new Date(value).toLocaleString(),
},
{
field: 'updatedAt',
headerName: t('admin:entryViewUpdated'),
width: 175,
valueFormatter: ({ value }: { value: Date }) =>
new Date(value).toLocaleString(),
valueFormatter: (value: Date) => new Date(value).toLocaleString(),
},
{
field: 'sessionToken',
Expand Down

0 comments on commit f74c43f

Please sign in to comment.