11import { Paper , Stack , Table , TableBody , TableCell , TableContainer , TableHead , TableRow } from '@mui/material' ;
22import moment from 'moment' ;
3- import React , { useEffect , useMemo } from 'react' ;
3+ import React , { useEffect } from 'react' ;
44import { useTranslation } from 'react-i18next' ;
55import RecordRoutes from '../api/RecordRoutes' ;
66import useStateAsync from '../hooks/useStateAsync' ;
@@ -18,15 +18,10 @@ const ActionsTable = ({
1818} : ActionsTableProps ) => {
1919 const { t } = useTranslation ( 'actions' ) ;
2020
21- const recordsFetchProps = useMemo ( ( ) => ( {
22- object,
23- fetchPath : '(id, actionTime, actionType, objectType, author(person(firstName, lastName)))' ,
24- } ) , [ object ] ) ;
25-
2621 const { data : records , reload : reloadRecords } = useStateAsync (
2722 [ ] ,
2823 RecordRoutes . list ,
29- recordsFetchProps ,
24+ object ,
3025 ) ;
3126
3227 // Reload table when new record is added and/or when reloadActions is updated
@@ -67,10 +62,10 @@ const ActionsTable = ({
6762 < TableCell component = "th" scope = "row" > { t ( 'anonymousAuthor' ) } </ TableCell >
6863 ) }
6964 { ! object && (
70- < TableCell align = "right" > { action . objectType } </ TableCell >
65+ < TableCell align = "right" > { action . object } </ TableCell >
7166 ) }
72- < TableCell align = "right" > { action . actionType } </ TableCell >
73- < TableCell align = "right" > { moment ( action . actionTime ) . format ( 'DD/MM/YYYY HH:mm' ) } </ TableCell >
67+ < TableCell align = "right" > { action . action } </ TableCell >
68+ < TableCell align = "right" > { moment ( action . date ) . format ( 'DD/MM/YYYY HH:mm' ) } </ TableCell >
7469 </ TableRow >
7570 ) )
7671 ) : (
0 commit comments