table fix

This commit is contained in:
Flatlogic Bot 2026-01-14 16:02:14 +00:00
parent 96711af5bc
commit 27055845ea
4 changed files with 14 additions and 8 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

View File

@ -291,8 +291,16 @@ router.get('/', wrapAsync(async (req, res) => {
const filetype = req.query.filetype
const currentUser = req.currentUser;
const { sort, ...otherFilters } = req.query;
let order = {};
if (sort) {
const [field, direction] = sort.split(',');
order = { field, sort: direction };
}
const payload = await EventsDBApi.findAll(
req.query, { currentUser }
{ ...otherFilters, ...order }, { currentUser }
);
if (filetype && filetype === 'csv') {
const fields = ['id','name','description',

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

View File

@ -23,7 +23,7 @@ const Dashboard = () => {
useEffect(() => {
if(hasPermission(currentUser, 'READ_EVENTS')) {
dispatch(fetchEvents({ query: '?sort=createdAt,DESC&limit=5' }));
dispatch(fetchEvents({ query: '?sort=start_datetime,ASC&limit=5' }));
}
if(hasPermission(currentUser, 'READ_GUESTS')) {
dispatch(fetchGuests({ query: '' }));
@ -31,7 +31,7 @@ const Dashboard = () => {
}, [dispatch, currentUser]);
const upcomingEvents = events.filter(
(event) => new Date(event.date) > new Date()
(event) => new Date(event.start_datetime) > new Date()
);
return (
@ -96,19 +96,17 @@ const Dashboard = () => {
events.map((event) => (
<tr key={event.id}>
<td className="px-6 py-4 whitespace-nowrap">{event.name}</td>
<td className="px-6 py-4 whitespace-nowrap">
{new Date(event.date).toLocaleDateString()}
</td>
<td className="px-6 py-4 whitespace-nowrap">{new Date(event.start_datetime).toLocaleDateString()}</td>
<td className="px-6 py-4 whitespace-nowrap">{event.location}</td>
<td className="px-6 py-4 whitespace-nowrap">
<span
className={`px-2 inline-flex text-xs leading-5 font-semibold rounded-full ${
new Date(event.date) < new Date()
new Date(event.start_datetime) < new Date()
? 'bg-red-100 text-red-800'
: 'bg-green-100 text-green-800'
}`}
>
{new Date(event.date) < new Date() ? 'Past' : 'Upcoming'}
{new Date(event.start_datetime) < new Date() ? 'Past' : 'Upcoming'}
</span>
</td>
<td className="px-6 py-4 whitespace-nowrap text-right text-sm font-medium">