Fix for event selection

This commit is contained in:
Torsten Schulz
2024-07-04 17:02:44 +02:00
parent c96214c10a
commit 054d1d0f2e

View File

@@ -32,7 +32,7 @@ const filterEvents = async (req, res) => {
]
}
},
{ dayOfWeek: { [Op.ne]: null } }
{ dayOfWeek: { [Op.gte]: 0 } }
]
};
@@ -44,7 +44,8 @@ const filterEvents = async (req, res) => {
{ model: EventPlace, as: 'eventPlace' },
{ model: EventType, as: 'eventType' },
{ model: ContactPerson, as: 'contactPersons', through: { attributes: [] } }
]
],
logging: console.log // Log the generated SQL query
});
return res.json({ events });
}
@@ -60,7 +61,7 @@ const filterEvents = async (req, res) => {
{ model: EventPlace, as: 'eventPlace' },
{ model: EventType, as: 'eventType' },
{ model: ContactPerson, as: 'contactPersons', through: { attributes: [] } }
]
],
});
return res.json({ events });
}
@@ -92,7 +93,8 @@ const filterEvents = async (req, res) => {
{ model: EventPlace, as: 'eventPlace' },
{ model: EventType, as: 'eventType' },
{ model: ContactPerson, as: 'contactPersons', through: { attributes: [] } }
]
],
logging: console.log // Log the generated SQL query
});
const displayFields = request.display ? request.display : [];