table fix
This commit is contained in:
parent
96711af5bc
commit
27055845ea
BIN
assets/pasted-20260114-155921-75e1e840.jpg
Normal file
BIN
assets/pasted-20260114-155921-75e1e840.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 51 KiB |
@ -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',
|
||||
|
||||
BIN
frontend/public/assets/vm-shot-2026-01-14T15-59-17-801Z.jpg
Normal file
BIN
frontend/public/assets/vm-shot-2026-01-14T15-59-17-801Z.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 51 KiB |
@ -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">
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user