Skip to content

Commit

Permalink
added a submitted date column
Browse files Browse the repository at this point in the history
relates #206
  • Loading branch information
alidah0 committed Jun 10, 2020
1 parent d54c720 commit 29b1ac3
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions client/src/components/pages/admin/Submitted_all/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ const Header = {
{ title: 'Name', field: 'fullName', width: '20%' },
{ title: 'Email', field: 'email', width: '20%' },
{ title: 'Mobile', field: 'mobileNumber' },
{ title: 'Age', field: 'age' },
{
title: 'Submitted Date',
field: 'applicationSubmittedDate',
},
{ title: 'Academy Location', field: 'location' },
{ title: 'Address', field: 'address' },
{
Expand All @@ -40,7 +43,17 @@ const SubmittedApplications = () => {
const [submitted, setSubmitted] = useState();

useEffect(() => {
if (!submitted) getSubmitted().then(setSubmitted);
if (!submitted)
getSubmitted()
.then((arr) =>
arr.map((obj) => ({
...obj,
applicationSubmittedDate: obj.applicationSubmittedDate.split(
'T'
)[0],
}))
)
.then(setSubmitted);
}, [submitted]);

return (
Expand Down

0 comments on commit 29b1ac3

Please sign in to comment.